From: David Levine Date: Tue, 17 Jan 2012 00:33:57 +0000 (-0600) Subject: Pass int instead of char to iscntrl() and isspace() because that's what they require... X-Git-Url: http://git.marmaro.de/?a=commitdiff_plain;h=7b3154538d24958c2e3ed0e20e80bb33d3d98a3a;p=mmh Pass int instead of char to iscntrl() and isspace() because that's what they require, and gcc on Cygwin warns about it. --- diff --git a/sbr/fmt_scan.c b/sbr/fmt_scan.c index de20013..9c1eb16 100644 --- a/sbr/fmt_scan.c +++ b/sbr/fmt_scan.c @@ -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) {