diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/dhry/cmd_dhry.c | 2 | ||||
-rw-r--r-- | lib/fdtdec.c | 2 | ||||
-rw-r--r-- | lib/net_utils.c | 2 | ||||
-rw-r--r-- | lib/strto.c | 7 |
4 files changed, 9 insertions, 4 deletions
diff --git a/lib/dhry/cmd_dhry.c b/lib/dhry/cmd_dhry.c index d55ab54..77b52a2 100644 --- a/lib/dhry/cmd_dhry.c +++ b/lib/dhry/cmd_dhry.c @@ -16,7 +16,7 @@ static int do_dhry(struct cmd_tbl *cmdtp, int flag, int argc, int iterations = 1000000; if (argc > 1) - iterations = simple_strtoul(argv[1], NULL, 10); + iterations = dectoul(argv[1], NULL); start = get_timer(0); dhry(iterations); diff --git a/lib/fdtdec.c b/lib/fdtdec.c index 4b097fb..07c7ebe 100644 --- a/lib/fdtdec.c +++ b/lib/fdtdec.c @@ -405,7 +405,7 @@ int fdtdec_add_aliases_for_id(const void *blob, const char *name, continue; /* Get the alias number */ - number = simple_strtoul(path + name_len, NULL, 10); + number = dectoul(path + name_len, NULL); if (number < 0 || number >= maxcount) { debug("%s: warning: alias '%s' is out of range\n", __func__, path); diff --git a/lib/net_utils.c b/lib/net_utils.c index f596c8f..72a3b09 100644 --- a/lib/net_utils.c +++ b/lib/net_utils.c @@ -23,7 +23,7 @@ struct in_addr string_to_ip(const char *s) return addr; for (addr.s_addr = 0, i = 0; i < 4; ++i) { - ulong val = s ? simple_strtoul(s, &e, 10) : 0; + ulong val = s ? dectoul(s, &e) : 0; if (val > 255) { addr.s_addr = 0; return addr; diff --git a/lib/strto.c b/lib/strto.c index 57d6216..72903a5 100644 --- a/lib/strto.c +++ b/lib/strto.c @@ -54,6 +54,11 @@ ulong hextoul(const char *cp, char **endp) return simple_strtoul(cp, endp, 16); } +ulong dectoul(const char *cp, char **endp) +{ + return simple_strtoul(cp, endp, 10); +} + int strict_strtoul(const char *cp, unsigned int base, unsigned long *res) { char *tail; @@ -164,7 +169,7 @@ long trailing_strtoln(const char *str, const char *end) if (isdigit(end[-1])) { for (p = end - 1; p > str; p--) { if (!isdigit(*p)) - return simple_strtoul(p + 1, NULL, 10); + return dectoul(p + 1, NULL); } } |