Replaced the use of isspace() with our own version instead since we have most

data as 'char *' and that makes us pass in negative values if there is 8bit
data in the string. Changing to unsigned causes too much warnings or too many
required typecasts to the normal string functions.
This commit is contained in:
Daniel Stenberg 2004-10-03 21:02:01 +00:00
Родитель f4252f8672
Коммит be7ce435c0
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -84,7 +84,6 @@ Example set of cookies:
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "urldata.h"
#include "cookie.h"
@ -98,6 +97,8 @@ Example set of cookies:
#include "memdebug.h"
#endif
#define my_isspace(x) ((x == ' ') || (x == '\t'))
static void freecookie(struct Cookie *co)
{
if(co->expirestr)
@ -175,7 +176,7 @@ Curl_cookie_add(struct SessionHandle *data,
semiptr=strchr(lineptr, ';'); /* first, find a semicolon */
while(*lineptr && isspace((int)*lineptr))
while(*lineptr && my_isspace(*lineptr))
lineptr++;
ptr = lineptr;
@ -198,14 +199,14 @@ Curl_cookie_add(struct SessionHandle *data,
/* Strip off trailing whitespace from the 'what' */
size_t len=strlen(what);
while(len && isspace((int)what[len-1])) {
while(len && my_isspace(what[len-1])) {
what[len-1]=0;
len--;
}
/* Skip leading whitespace from the 'what' */
whatptr=what;
while(isspace((int)*whatptr)) {
while(my_isspace(*whatptr)) {
whatptr++;
}
@ -347,7 +348,7 @@ Curl_cookie_add(struct SessionHandle *data,
}
ptr=semiptr+1;
while(ptr && *ptr && isspace((int)*ptr))
while(ptr && *ptr && my_isspace(*ptr))
ptr++;
semiptr=strchr(ptr, ';'); /* now, find the next semicolon */
@ -667,7 +668,7 @@ struct CookieInfo *Curl_cookie_init(struct SessionHandle *data,
lineptr=line;
headerline=FALSE;
}
while(*lineptr && isspace((int)*lineptr))
while(*lineptr && my_isspace(*lineptr))
lineptr++;
Curl_cookie_add(data, c, headerline, lineptr, NULL, NULL);