Use strtoul in expand(1) and force base 10
This commit is contained in:
parent
692c11bf2b
commit
5f448d9a8b
2
expand.c
2
expand.c
|
@ -33,7 +33,7 @@ parselist(const char *s, size_t slen)
|
||||||
|
|
||||||
m = 0;
|
m = 0;
|
||||||
for (i = 0; i < slen; i += sep - (s + i) + 1) {
|
for (i = 0; i < slen; i += sep - (s + i) + 1) {
|
||||||
tablist[m++] = strtol(s + i, &sep, 0);
|
tablist[m++] = strtoul(s + i, &sep, 10);
|
||||||
if (tablist[m - 1] == 0)
|
if (tablist[m - 1] == 0)
|
||||||
eprintf("expand: tab size can't be zero.\n");
|
eprintf("expand: tab size can't be zero.\n");
|
||||||
if (*sep && *sep != ',' && *sep != ' ')
|
if (*sep && *sep != ',' && *sep != ' ')
|
||||||
|
|
Loading…
Reference in New Issue
Block a user