aboutsummaryrefslogtreecommitdiff
path: root/contrib/string/string_io.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-12-03 20:45:40 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-12-03 20:45:40 +0000
commita27b691e2903a886be640db801677f6f988d3793 (patch)
treec68f25c9edef18954e9c5b3d74893f1df87b8871 /contrib/string/string_io.c
parent4d2a506526ceacab5f75df040596a5287ab40612 (diff)
downloadpostgresql-a27b691e2903a886be640db801677f6f988d3793.tar.gz
postgresql-a27b691e2903a886be640db801677f6f988d3793.zip
Ensure that all uses of <ctype.h> functions are applied to unsigned-char
values, whether the local char type is signed or not. This is necessary for portability. Per discussion on pghackers around 9/16/00.
Diffstat (limited to 'contrib/string/string_io.c')
-rw-r--r--contrib/string/string_io.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/contrib/string/string_io.c b/contrib/string/string_io.c
index c329fec1e9e..8c4e5b45e1a 100644
--- a/contrib/string/string_io.c
+++ b/contrib/string/string_io.c
@@ -28,9 +28,10 @@
#define DIGIT(val) ((val) + '0')
#define ISOCTAL(c) (((c) >= '0') && ((c) <= '7'))
#ifndef ISO8859
-#define NOTPRINTABLE(c) (!isprint(c))
+#define NOTPRINTABLE(c) (!isprint((unsigned char) (c)))
#else
-#define NOTPRINTABLE(c) (!isprint(c) && ((c) < 0xa0))
+#define NOTPRINTABLE(c) (!isprint((unsigned char) (c)) && \
+ ((unsigned char) (c) < (unsigned char) 0xa0))
#endif
/*