Skip to content

Commit 6ad853b

Browse files
committed
Yet another place where someone was being careless about the arguments
of <ctype.h> macros.
1 parent a28961d commit 6ad853b

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/backend/utils/adt/arrayfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.110 2004/08/29 05:06:49 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/adt/arrayfuncs.c,v 1.111 2004/09/02 20:05:40 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -543,7 +543,7 @@ ArrayCount(char *str, int *dim, char typdelim)
543543
itemdone = true;
544544
nelems[nest_level - 1]++;
545545
}
546-
else if (!isspace(*ptr))
546+
else if (!isspace((unsigned char) *ptr))
547547
{
548548
/*
549549
* Other non-space characters must be after a
@@ -572,7 +572,7 @@ ArrayCount(char *str, int *dim, char typdelim)
572572
/* only whitespace is allowed after the closing brace */
573573
while (*ptr)
574574
{
575-
if (!isspace(*ptr++))
575+
if (!isspace((unsigned char) *ptr++))
576576
ereport(ERROR,
577577
(errcode(ERRCODE_INVALID_TEXT_REPRESENTATION),
578578
errmsg("malformed array literal: \"%s\"", str)));

src/bin/pg_ctl/pg_ctl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
66
*
7-
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.30 2004/08/29 05:06:53 momjian Exp $
7+
* $PostgreSQL: pgsql/src/bin/pg_ctl/pg_ctl.c,v 1.31 2004/09/02 20:07:50 tgl Exp $
88
*
99
*-------------------------------------------------------------------------
1010
*/
@@ -355,21 +355,21 @@ test_postmaster_connection(void)
355355
for (p = post_opts; *p;)
356356
{
357357
/* advance past whitespace/quoting */
358-
while (isspace(*p) || *p == '\'' || *p == '"')
358+
while (isspace((unsigned char) *p) || *p == '\'' || *p == '"')
359359
p++;
360360

361361
if (strncmp(p, "-p", strlen("-p")) == 0)
362362
{
363363
p += strlen("-p");
364364
/* advance past whitespace/quoting */
365-
while (isspace(*p) || *p == '\'' || *p == '"')
365+
while (isspace((unsigned char) *p) || *p == '\'' || *p == '"')
366366
p++;
367367
StrNCpy(portstr, p, Min(strcspn(p, "\"'" WHITESPACE) + 1,
368368
sizeof(portstr)));
369369
/* keep looking, maybe there is another -p */
370370
}
371371
/* Advance to next whitespace */
372-
while (*p && !isspace(*p))
372+
while (*p && !isspace((unsigned char) *p))
373373
p++;
374374
}
375375

@@ -385,17 +385,17 @@ test_postmaster_connection(void)
385385
{
386386
p = *optlines;
387387

388-
while (isspace(*p))
388+
while (isspace((unsigned char) *p))
389389
p++;
390390
if (strncmp(p, "port", strlen("port")) != 0)
391391
continue;
392392
p += strlen("port");
393-
while (isspace(*p))
393+
while (isspace((unsigned char) *p))
394394
p++;
395395
if (*p != '=')
396396
continue;
397397
p++;
398-
while (isspace(*p))
398+
while (isspace((unsigned char) *p))
399399
p++;
400400
StrNCpy(portstr, p, Min(strcspn(p, "#" WHITESPACE) + 1,
401401
sizeof(portstr)));

0 commit comments

Comments
 (0)