about summary refs log tree commit diff
path: root/stdio-common
diff options
context:
space:
mode:
Diffstat (limited to 'stdio-common')
-rw-r--r--stdio-common/printf_fp.c12
-rw-r--r--stdio-common/vfprintf.c6
2 files changed, 15 insertions, 3 deletions
diff --git a/stdio-common/printf_fp.c b/stdio-common/printf_fp.c
index 34fe918237..d1004356b4 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)
diff --git a/stdio-common/vfprintf.c b/stdio-common/vfprintf.c
index db6f3e4842..1cd8d2178a 100644
--- a/stdio-common/vfprintf.c
+++ b/stdio-common/vfprintf.c
@@ -1514,7 +1514,11 @@ group_number (CHAR_T *w, CHAR_T *rear_ptr, const CHAR_T *grouping,
 	  if (*grouping == '\0')
 	    /* The previous grouping repeats ad infinitum.  */
 	    --grouping;
-	  else if (*grouping == CHAR_MAX || *grouping < 0)
+	  else if (*grouping == CHAR_MAX
+#if CHAR_MIN < 0
+		   || *grouping < 0
+#endif
+		   )
 	    {
 	      /* No further grouping to be done.
 		 Copy the rest of the number.  */