1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

main.c: Use assertion to test buffer size

This commit is contained in:
Darshit Shah 2015-03-07 00:29:11 +05:30
parent 9dde436dd6
commit e316d253fa

View File

@ -340,8 +340,7 @@ no_prefix (const char *s)
char *cp = p;
int size = 3 + strlen (s) + 1; /* "no-STRING\0" */
if (p + size >= buffer + sizeof (buffer))
abort ();
assert(p + size <= buffer + sizeof (buffer));
cp[0] = 'n', cp[1] = 'o', cp[2] = '-';
strcpy (cp + 3, s);