From a27b691e2903a886be640db801677f6f988d3793 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 3 Dec 2000 20:45:40 +0000 Subject: Ensure that all uses of 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. --- src/backend/utils/adt/varlena.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/backend/utils/adt/varlena.c') diff --git a/src/backend/utils/adt/varlena.c b/src/backend/utils/adt/varlena.c index b075bf91112..89ca5c4ecd7 100644 --- a/src/backend/utils/adt/varlena.c +++ b/src/backend/utils/adt/varlena.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.65 2000/07/29 03:26:42 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/varlena.c,v 1.66 2000/12/03 20:45:36 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -56,9 +56,9 @@ byteain(PG_FUNCTION_ARGS) { if (*tp == '\\') tp++; - else if (!isdigit((int) *tp++) || - !isdigit((int) *tp++) || - !isdigit((int) *tp++)) + else if (!isdigit((unsigned char) *tp++) || + !isdigit((unsigned char) *tp++) || + !isdigit((unsigned char) *tp++)) elog(ERROR, "Bad input string for type bytea"); } } @@ -111,7 +111,7 @@ byteaout(PG_FUNCTION_ARGS) { if (*vp == '\\') len += 2; - else if (isascii((int) *vp) && isprint((int) *vp)) + else if (isprint((unsigned char) *vp)) len++; else len += 4; @@ -125,7 +125,7 @@ byteaout(PG_FUNCTION_ARGS) *rp++ = '\\'; *rp++ = '\\'; } - else if (isascii((int) *vp) && isprint((int) *vp)) + else if (isprint((unsigned char) *vp)) *rp++ = *vp; else { -- cgit v1.2.3