]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
(get_format_width, get_format_prec): Avoid
authorJim Meyering <jim@meyering.net>
Sat, 14 Dec 1996 05:22:46 +0000 (05:22 +0000)
committerJim Meyering <jim@meyering.net>
Sat, 14 Dec 1996 05:22:46 +0000 (05:22 +0000)
unnecessary comparison of digit to '\0'.

src/csplit.c

index e3de13a0f7c4f9322a257ef034795e1d2266dbd2..12862c8158a4ebc43b0caf870b1e4b5a081b979c 100644 (file)
@@ -1306,9 +1306,8 @@ get_format_width (char **format_ptr)
   int ch_save;
 
   start = *format_ptr;
-  for (; **format_ptr; (*format_ptr)++)
-    if (!ISDIGIT (**format_ptr))
-      break;
+  for (; ISDIGIT (**format_ptr); (*format_ptr)++)
+    continue;
 
   ch_save = **format_ptr;
   **format_ptr = '\0';
@@ -1344,9 +1343,8 @@ get_format_prec (char **format_ptr)
     }
 
   start = *format_ptr;
-  for (; **format_ptr; (*format_ptr)++)
-    if (!ISDIGIT (**format_ptr))
-      break;
+  for (; ISDIGIT (**format_ptr); (*format_ptr)++)
+    continue;
 
   /* ANSI 4.9.6.1 says that if the precision is negative, it's as good as
      not there. */