From 7b3154538d24958c2e3ed0e20e80bb33d3d98a3a Mon Sep 17 00:00:00 2001 From: David Levine Date: Mon, 16 Jan 2012 18:33:57 -0600 Subject: [PATCH] Pass int instead of char to iscntrl() and isspace() because that's what they require, and gcc on Cygwin warns about it. --- sbr/fmt_scan.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) { -- 1.7.10.4