aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2009-06-04 08:27:54 +0000
committerAlan Modra <amodra@gmail.com>2009-06-04 08:27:54 +0000
commite36aef42209e57273a78919b81cc7ae62d32107a (patch)
tree17e6e2af4914b6df36340b18401f91c9231cd2d4
parent67a648f17aaf9902891ec61c8025b98612dbbab4 (diff)
downloadgdb-e36aef42209e57273a78919b81cc7ae62d32107a.zip
gdb-e36aef42209e57273a78919b81cc7ae62d32107a.tar.gz
gdb-e36aef42209e57273a78919b81cc7ae62d32107a.tar.bz2
* strings.c (main): Delay parsing of decimal digits.
-rw-r--r--binutils/ChangeLog4
-rw-r--r--binutils/strings.c11
2 files changed, 12 insertions, 3 deletions
diff --git a/binutils/ChangeLog b/binutils/ChangeLog
index 74ff09e..dc4f09b 100644
--- a/binutils/ChangeLog
+++ b/binutils/ChangeLog
@@ -1,5 +1,9 @@
2009-06-04 Alan Modra <amodra@bigpond.net.au>
+ * strings.c (main): Delay parsing of decimal digits.
+
+2009-06-04 Alan Modra <amodra@bigpond.net.au>
+
* dep-in.sed: Don't use \n in replacement part of s command.
* Makefile.am (DEP1): LC_ALL for uniq.
Run "make dep-am".
diff --git a/binutils/strings.c b/binutils/strings.c
index dc582f5..06fd8e9 100644
--- a/binutils/strings.c
+++ b/binutils/strings.c
@@ -158,6 +158,7 @@ main (int argc, char **argv)
int exit_status = 0;
bfd_boolean files_given = FALSE;
char *s;
+ int numeric_opt = 0;
#if defined (HAVE_SETLOCALE)
setlocale (LC_ALL, "");
@@ -247,13 +248,17 @@ main (int argc, char **argv)
usage (stderr, 1);
default:
- string_min = (int) strtoul (argv[optind - 1] + 1, &s, 0);
- if (s != NULL && *s != 0)
- fatal (_("invalid integer argument %s"), argv[optind - 1] + 1);
+ numeric_opt = optind;
break;
}
}
+ if (numeric_opt != 0)
+ {
+ string_min = (int) strtoul (argv[numeric_opt - 1] + 1, &s, 0);
+ if (s != NULL && *s != 0)
+ fatal (_("invalid integer argument %s"), argv[numeric_opt - 1] + 1);
+ }
if (string_min < 1)
fatal (_("invalid minimum string length %d"), string_min);