2 ms·
That would introduce a bug. See the following: #include <stdio.h> int main() { printf("%lu\n", strlen("_shutdown")); printf("%lu\n"
by smcl 3y ago
That would introduce a bug. See the following:
#include <stdio.h>
int main()
{
printf("%lu\n", strlen("_shutdown"));
printf("%lu\n", sizeof("_shutdown"));
return 0;
}
This prints the numbers 9 and 10 (on gcc I have). So if you used `sizeof(...)+1` when calculating the length argument for strcmp you'd be comparing the 9-byte string, the null terminator and one character of random nonsense.