summaryrefslogtreecommitdiff
path: root/contrib/spi
diff options
context:
space:
mode:
authorTom Lane2000-12-03 20:45:40 +0000
committerTom Lane2000-12-03 20:45:40 +0000
commita27b691e2903a886be640db801677f6f988d3793 (patch)
treec68f25c9edef18954e9c5b3d74893f1df87b8871 /contrib/spi
parent4d2a506526ceacab5f75df040596a5287ab40612 (diff)
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/spi')
-rw-r--r--contrib/spi/preprocessor/step1.c2
-rw-r--r--contrib/spi/refint.c4
-rw-r--r--contrib/spi/timetravel.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/contrib/spi/preprocessor/step1.c b/contrib/spi/preprocessor/step1.c
index 1f2c5380d51..8a5379e8e04 100644
--- a/contrib/spi/preprocessor/step1.c
+++ b/contrib/spi/preprocessor/step1.c
@@ -6,7 +6,7 @@ strtoupper(char *string)
int i;
for (i = 0; i < strlen(string); i++)
- string[i] = toupper(string[i]);
+ string[i] = toupper((unsigned char) string[i]);
return string;
}
diff --git a/contrib/spi/refint.c b/contrib/spi/refint.c
index d7a8d73c8e1..ea8851816f5 100644
--- a/contrib/spi/refint.c
+++ b/contrib/spi/refint.c
@@ -5,7 +5,7 @@
#include "executor/spi.h" /* this is what you need to work with SPI */
#include "commands/trigger.h" /* -"- and triggers */
-#include <ctype.h> /* tolower () */
+#include <ctype.h>
extern Datum check_primary_key(PG_FUNCTION_ARGS);
@@ -293,7 +293,7 @@ check_foreign_key(PG_FUNCTION_ARGS)
nrefs = pg_atoi(args[0], sizeof(int), 0);
if (nrefs < 1)
elog(ERROR, "check_foreign_key: %d (< 1) number of references specified", nrefs);
- action = tolower(*(args[1]));
+ action = tolower((unsigned char) *(args[1]));
if (action != 'r' && action != 'c' && action != 's')
elog(ERROR, "check_foreign_key: invalid action %s", args[1]);
nargs -= 2;
diff --git a/contrib/spi/timetravel.c b/contrib/spi/timetravel.c
index 41e7b092b32..90341e208d2 100644
--- a/contrib/spi/timetravel.c
+++ b/contrib/spi/timetravel.c
@@ -5,7 +5,7 @@
#include "executor/spi.h" /* this is what you need to work with SPI */
#include "commands/trigger.h" /* -"- and triggers */
-#include <ctype.h> /* tolower () */
+#include <ctype.h>
#define ABSTIMEOID 702 /* it should be in pg_type.h */
@@ -376,7 +376,7 @@ set_timetravel(PG_FUNCTION_ARGS)
NameGetDatum(relname)));
d = TTOff[nTTOff] = malloc(strlen(rname) + 1);
while (*s)
- *d++ = tolower(*s++);
+ *d++ = tolower((unsigned char) *s++);
*d = 0;
pfree(rname);
nTTOff++;