Commit 859cbb40 authored by Gerd Moellmann's avatar Gerd Moellmann
Browse files

(get_keyword): Make sure that isspace and

similar aren't called with a negative argument.
parent af03e6ab
......@@ -253,18 +253,18 @@ get_keyword (field, rest)
{
static char keyword[KEYWORD_SIZE];
register char *ptr;
register char c;
register int c;
ptr = &keyword[0];
c = *field++;
c = (unsigned char) *field++;
if (isspace (c) || c == ':')
return ((char *) NULL);
*ptr++ = (islower (c) ? toupper (c) : c);
while (((c = *field++) != ':') && ! isspace (c))
while (((c = (unsigned char) *field++) != ':') && ! isspace (c))
*ptr++ = (islower (c) ? toupper (c) : c);
*ptr++ = '\0';
while (isspace (c))
c = *field++;
c = (unsigned char) *field++;
if (c != ':')
return ((char *) NULL);
*rest = field;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment