]> git.pond.sub.org Git - empserver/commitdiff
(journal_entry): Add unsigned char cast to isprint() call.
authorRon Koenderink <rkoenderink@yahoo.ca>
Sat, 10 Mar 2007 18:12:29 +0000 (18:12 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sat, 10 Mar 2007 18:12:29 +0000 (18:12 +0000)
(parse): Add unsigned char cast to isspace() call.
Portability bug fix for WIN32.

src/lib/common/journal.c
src/lib/gen/parse.c

index 1a9841ba4f73c7e08eabda247efa02c2fb020ea1..d21aeb12bef56215e0fd26e5b5a083dd6e81f96e 100644 (file)
@@ -85,7 +85,7 @@ journal_entry(char *fmt, ...)
        va_end(ap);
 
        for (i = n; buf[i]; ++i) {
-           if (!isprint(buf[i]))
+           if (!isprint((unsigned char)buf[i]))
                buf[i] = '?';   /* FIXME replace by escape */
        }
        buf[i++] = '\n';
index f85364295182ce90b69b608bd339806cb484b7b2..778f2c494590fa7882623d46136689097c026477 100644 (file)
@@ -64,7 +64,7 @@ parse(char *buf, char **arg, char **condp, char *space, char **redir)
     if (condp != NULL)
        *condp = NULL;
     for (argnum = 0; *buf && argnum < 127;) {
-       while (isspace(*buf))
+       while (isspace((unsigned char)*buf))
            buf++;
        if (!*buf)
            break;
@@ -74,7 +74,7 @@ parse(char *buf, char **arg, char **condp, char *space, char **redir)
        }
        quoted = 0;
        for (bp2 = bp1; *buf;) {
-           if (!quoted && isspace(*buf)) {
+           if (!quoted && isspace((unsigned char)*buf)) {
                buf++;
                break;
            }