if (!isspace(buffer[i]))
if (!isspace((int) buffer[i]))
kn_read_asserts(char *buffer, int bufferlen, int *numassertions){    int bufsize = 32, i, flag, valid;    char **buf, **tempbuf, *ptr;    keynote_errno = 0;    if (buffer == (char *) NULL)    {	keynote_errno = ERROR_SYNTAX;	return (char **) NULL;    }    buf = (char **) calloc(bufsize, sizeof(char *));    if (buf == (char **) NULL)    {	keynote_errno = ERROR_MEMORY;	return (char **) NULL;    }    /*     * We'll go through the whole buffer looking for consecutive newlines,     * which imply newline separation. We use the valid flag to keep     * track of whether there may be an assertion after the last pair of     * newlines, or whether there may be an assertion in the buffer to     * begin with, if there are no consecutive newlines.     */    for (i = 0, flag = 0, valid = 0, *numassertions = 0, ptr = buffer;	 i < bufferlen;	 i++)    {	if (buffer[i] == '\n')	{	    if (flag)  /* Two newlines in a row, copy if there's anything */	    {		if (valid)  /* Something there */		{		    /* Allocate enough memory */		    buf[*numassertions] = (char *) calloc((buffer + i) - ptr							  + 1, sizeof(char));		    if (buf[*numassertions] == (char *) NULL)		    {			/* Free any already-allocated strings */			for (flag = 0; flag < *numassertions; flag++)			  free(buf[flag]);			free(buf);			keynote_errno = ERROR_MEMORY;			return (char **) NULL;		    }		    /* Copy string */		    memcpy(buf[*numassertions], ptr, (buffer + i) - ptr);		    (*numassertions)++;		}		valid = 0; /* Reset */		flag = 0;		ptr = buffer + i + 1; /* Point right after this newline */		/* See if we need to resize the buffer */		if (*numassertions > bufsize - 4)		{		    /* Allocate twice the space */		    tempbuf = (char **) realloc(buf, 2 * bufsize *						sizeof(char *));		    if (tempbuf == (char **) NULL)		    {			for (flag = 0; flag < *numassertions; flag++)			  free(buf[flag]);			free(buf);			keynote_errno = ERROR_MEMORY;			return (char **) NULL;		    }		    free(buf);     /* Free old buffer */		    buf = tempbuf;		    bufsize *= 2;		}	    }	    else	      flag = 1;  /* One newline so far */	    continue;	}	else	  flag = 0;	if (!isspace(buffer[i]))	  valid = 1;    }    /*     * There may be a valid assertion after the last pair of newlines.     * Notice that because of the resizing check above, there will be     * a valid memory location to store this last string.     */    if (valid)    {	/* This one's easy, we can just use strdup() */	if ((buf[*numassertions] = strdup(ptr)) == (char *) NULL)	{	    for (flag = 0; flag < *numassertions; flag++)	      free(buf[flag]);	    free(buf);	    keynote_errno = ERROR_MEMORY;	    return (char **) NULL;	}	(*numassertions)++;    }    return buf;}