BytesClub / serverX

A HTTP/HTTPS Web Server Handler by (C) Bytes Club
Other
3 stars 3 forks source link

Overflow: Use snprintf in place of sprintf #7

Closed 0xTheProDev closed 7 years ago

0xTheProDev commented 7 years ago

Prototype

int sprintf(char * str, const char * format, ...);

int snprintf(char * str, size_t size, const char * format, ...);

Advantage

snprintf only prints upto size_t size value avoiding overflow error!

Reference