summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1997-03-19 02:12:36 +0000
committerJim Meyering <jim@meyering.net>1997-03-19 02:12:36 +0000
commit33da7dcdda591435f069e7089184bced4b9e9ddc (patch)
tree30855c7c9d61c1899bf5903195495f6925e35b05 /src
parent3f2ded808df696cff236f6469d7ded8c23f623fa (diff)
downloadcoreutils-33da7dcdda591435f069e7089184bced4b9e9ddc.tar.xz
(check_format): Rename local, FORMAT_STRING, to avoid shadowing global.
(print_numbers): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/seq.c47
1 files changed, 23 insertions, 24 deletions
diff --git a/src/seq.c b/src/seq.c
index 472752d76..cba3c2503 100644
--- a/src/seq.c
+++ b/src/seq.c
@@ -257,46 +257,45 @@ scan_double_arg (const char *arg)
Return 0 if not, 1 if correct. */
static int
-check_format (const char *format_string)
+check_format (const char *fmt)
{
- while (*format_string != '\0')
+ while (*fmt != '\0')
{
- if (*format_string == '%')
+ if (*fmt == '%')
{
- format_string++;
- if (*format_string != '%')
+ fmt++;
+ if (*fmt != '%')
break;
}
- format_string++;
+ fmt++;
}
- if (*format_string == '\0')
+ if (*fmt == '\0')
return 0;
- format_string += strspn (format_string, "-+#0");
- if (isdigit (*format_string))
+ fmt += strspn (fmt, "-+#0");
+ if (isdigit (*fmt))
{
- format_string += strspn (format_string, "012345789");
+ fmt += strspn (fmt, "012345789");
- if (*format_string == '.')
- format_string += strspn (++format_string, "0123456789");
+ if (*fmt == '.')
+ fmt += strspn (++fmt, "0123456789");
}
- if (*format_string != 'e' && *format_string != 'f' &&
- *format_string != 'g')
+ if (*fmt != 'e' && *fmt != 'f' && *fmt != 'g')
return 0;
- format_string++;
- while (*format_string != '\0')
+ fmt++;
+ while (*fmt != '\0')
{
- if (*format_string == '%')
+ if (*fmt == '%')
{
- format_string++;
- if (*format_string != '%')
+ fmt++;
+ if (*fmt != '%')
return 0;
}
- format_string++;
+ fmt++;
}
return 1;
@@ -393,7 +392,7 @@ get_width_format (void)
/* Actually print the sequence of numbers in the specified range, with the
given or default stepping and format. */
static int
-print_numbers (const char *format_str)
+print_numbers (const char *fmt)
{
if (first > last)
{
@@ -408,7 +407,7 @@ the increment must be negative"));
/* NOTREACHED */
}
- printf (format_str, first);
+ printf (fmt, first);
for (i = 1; /* empty */; i++)
{
double x = first + i * step;
@@ -417,7 +416,7 @@ the increment must be negative"));
break;
fputs (separator, stdout);
- printf (format_str, x);
+ printf (fmt, x);
}
}
else
@@ -433,7 +432,7 @@ the increment must be positive"));
/* NOTREACHED */
}
- printf (format_str, first);
+ printf (fmt, first);
for (i = 1; /* empty */; i++)
{
double x = first + i * step;