Pass int instead of char to iscntrl() and isspace() because that's what they require...
authorDavid Levine <levinedl@acm.org>
Tue, 17 Jan 2012 00:33:57 +0000 (18:33 -0600)
committerDavid Levine <levinedl@acm.org>
Tue, 17 Jan 2012 00:33:57 +0000 (18:33 -0600)
sbr/fmt_scan.c

index de20013..9c1eb16 100644 (file)
@@ -155,7 +155,10 @@ cptrimmed(char **dest, char *str, unsigned int wid, char fill, size_t n) {
                sp += char_len;
 #else
            end--;
-           if (iscntrl(*sp) || isspace(*sp)) {
+            /* isnctrl(), etc., take an int argument.  Cygwin's ctype.h
+               intentionally warns if they are passed a char. */
+            int c = *sp;
+           if (iscntrl(c) || isspace(c)) {
                sp++;
 #endif
                if (!prevCtrl) {