4 ms·
Can a C guru provide a TL;DR of why these are bad?
by kgrimes2 6y ago
Can a C guru provide a TL;DR of why these are bad?
- syncsynchalt 6y ago- strcpy: no bounds check - strcat: no bounds check - strncpy: does not nul-terminate on overflow - strncat: no major issues, probably to force usage of strlcat - sprintf: no bounds check - vsprintf: no bounds check - gmtime: returns static memory - localtime: returns static memory - ctime: no bounds check - ctime_r: no bounds check - asctime: returns static memory - asctime_r: no bounds check The str functions all have safer alternatives. The time functions have reentrant alternatives, and/or alternatives that provide a bounds check.