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

Lines changed: 1 addition & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy