summaryrefslogtreecommitdiff
path: root/src/printf.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1992-12-07 05:32:19 +0000
committerJim Meyering <jim@meyering.net>1992-12-07 05:32:19 +0000
commitd6b0403a1dadac10387b50205901b2a4ead82ad9 (patch)
treed1c1e7beb181169c61a26efaf0e34b36d5234462 /src/printf.c
parent6afc161556e0e429ebc739a373fc02f33618fdb0 (diff)
downloadcoreutils-d6b0403a1dadac10387b50205901b2a4ead82ad9.tar.xz
(print_formatted, print_esc): Define ISXDIGIT and ISXDIGIT and use
them instead of isdigit and isxdigit.
Diffstat (limited to 'src/printf.c')
-rw-r--r--src/printf.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/printf.c b/src/printf.c
index a9979a6d8..1c43c0773 100644
--- a/src/printf.c
+++ b/src/printf.c
@@ -48,6 +48,13 @@
#include <sys/types.h>
#include "system.h"
+#ifndef isascii
+#define isascii(c) 1
+#endif
+
+#define ISDIGIT(c) (isascii (c) && isdigit (c))
+#define ISXDIGIT(c) (isascii (c) && isxdigit (c))
+
#ifndef STDC_HEADERS
double strtod ();
long strtol ();
@@ -168,7 +175,7 @@ print_formatted (format, argc, argv)
field_width = 0;
}
else
- while (isdigit (*f))
+ while (ISDIGIT (*f))
{
++f;
++direc_length;
@@ -191,7 +198,7 @@ print_formatted (format, argc, argv)
precision = 0;
}
else
- while (isdigit (*f))
+ while (ISDIGIT (*f))
{
++f;
++direc_length;
@@ -245,7 +252,7 @@ print_esc (escstart)
if (*p == 'x')
{
for (esc_length = 0, ++p;
- esc_length < 3 && isxdigit (*p);
+ esc_length < 3 && ISXDIGIT (*p);
++esc_length, ++p)
esc_value = esc_value * 16 + hextobin (*p);
if (esc_length == 0)