diff options
Diffstat (limited to 'stdio-common/printf_fp.c')
-rw-r--r-- | stdio-common/printf_fp.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c index 34fe918..d100435 100644 --- a/stdio-common/printf_fp.c +++ b/stdio-common/printf_fp.c @@ -982,7 +982,11 @@ __guess_grouping (unsigned int intdig_max, const char *grouping, ++groups; intdig_max -= *grouping++; - if (*grouping == CHAR_MAX || *grouping < 0) + if (*grouping == CHAR_MAX +#if CHAR_MIN < 0 + || *grouping < 0 +#endif + ) /* No more grouping should be done. */ break; else if (*grouping == 0) @@ -1023,7 +1027,11 @@ group_number (char *buf, char *bufend, unsigned int intdig_no, while (--len > 0); *p-- = thousands_sep; - if (*grouping == CHAR_MAX || *grouping < 0) + if (*grouping == CHAR_MAX +#if CHAR_MIN < 0 + || *grouping < 0 +#endif + ) /* No more grouping should be done. */ break; else if (*grouping == 0) |