1
0
mirror of https://github.com/postgres/postgres.git synced 2025-08-25 20:23:07 +03:00

Fix portability bugs: char values passed to <ctype.h> functions must

be cast to unsigned char.  We have learned this the hard way before.
This commit is contained in:
Tom Lane
2004-01-04 04:17:01 +00:00
parent 558ed5aee1
commit 4351f8823d
2 changed files with 8 additions and 8 deletions

View File

@@ -464,7 +464,7 @@ rstrdate(char *str, date * d)
for (i=0,j=0; i < 10; i++ )
{
/* ignore non-digits */
if ( isdigit(str[i]) )
if ( isdigit((unsigned char) str[i]) )
{
/* j only increments if it is a digit */
@@ -910,8 +910,8 @@ void
rupshift(char *str)
{
for (; *str != '\0'; str++)
if (islower(*str))
*str = toupper(*str);
if (islower((unsigned char) *str))
*str = toupper((unsigned char) *str);
return;
}