postgres.git / summary / log / commit / refs

commit    7a15fe5a2240244e2f80f25adfe6b9a34787a021
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Tue Nov 07 18:49:36 2017 +0000

    Fix unportable usage of <ctype.h> functions.
    
    isdigit(), isspace(), etc are likely to give surprising results if passed a
    signed char.  We should always cast the argument to unsigned char to avoid
    that.  Error in commit 63d6b97fd, found by buildfarm member gaur.
    Back-patch to 9.3, like that commit.


src/interfaces/ecpg/ecpglib/data.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interfaces/ecpg/ecpglib/data.c b/src/interfaces/ecpg/ecpglib/data.c index 60c94c8d582..230d7c6bcb8 100644 --- a/src/interfaces/ecpg/ecpglib/data.c +++ b/src/interfaces/ecpg/ecpglib/data.c @@ -59,7 +59,7 @@ garbage_left(enum ARRAY_TYPE isarray, char **scan_length, enum COMPAT_MODE compa /* skip invalid characters */ do { (*scan_length)++; - } while (isdigit(**scan_length)); + } while (isdigit((unsigned char) **scan_length)); } if (**scan_length != ' ' && **scan_length != '\0') [parent: de7dabfd35e8]