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
1 changed files with 1 additions and 2 deletions

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);