From 856dcb7c5ce2070f9b2355463d7aa2ed4b80c8a7 Mon Sep 17 00:00:00 2001 From: Ron Koenderink Date: Sat, 10 Mar 2007 18:12:29 +0000 Subject: [PATCH] (journal_entry): Add unsigned char cast to isprint() call. (parse): Add unsigned char cast to isspace() call. Portability bug fix for WIN32. --- src/lib/common/journal.c | 2 +- src/lib/gen/parse.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/common/journal.c b/src/lib/common/journal.c index 1a9841ba..d21aeb12 100644 --- a/src/lib/common/journal.c +++ b/src/lib/common/journal.c @@ -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'; diff --git a/src/lib/gen/parse.c b/src/lib/gen/parse.c index f8536429..778f2c49 100644 --- a/src/lib/gen/parse.c +++ b/src/lib/gen/parse.c @@ -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; }