mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
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.
This commit is contained in:
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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++;
|
||||
|
Reference in New Issue
Block a user