mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +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:
@ -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
|
||||
{
|
||||
|
Reference in New Issue
Block a user