Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit a0c2fa9

Browse files
committed
isdigit() needs an unsigned char argument.
Per the C standard, the routine should be passed an int, with a value that's representable as an unsigned char or EOF. Passing a signed char is wrong, because a negative value is not representable as an unsigned char. Unfortunately no compiler warns about that.
1 parent 94ae6ba commit a0c2fa9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/utils/adt/timestamp.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ parse_sane_timezone(struct pg_tm *tm, text *zone)
511511
* as invalid, it's enough to disallow having a digit in the first
512512
* position of our input string.
513513
*/
514-
if (isdigit(*tzname))
514+
if (isdigit((unsigned char) *tzname))
515515
ereport(ERROR,
516516
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
517517
errmsg("invalid input syntax for numeric time zone: \"%s\"",

0 commit comments

Comments
 (0)