diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-03 15:32:16 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-03 15:32:16 +0200 |
commit | 09151748500b86d3dc3322ac35100cab0b655c2d (patch) | |
tree | b1367fd6bfdd0ab63eaa1f81164659eb6619c4a4 /sys/src/libcontrol | |
parent | 9289c4b796b03fc1f164964466542090a2779be4 (diff) |
libcontrol: use strtol() to parse integer arguments
Diffstat (limited to 'sys/src/libcontrol')
-rw-r--r-- | sys/src/libcontrol/control.c | 4 | ||||
-rw-r--r-- | sys/src/libcontrol/menu.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/libcontrol/control.c b/sys/src/libcontrol/control.c index 62a441524..f83cea089 100644 --- a/sys/src/libcontrol/control.c +++ b/sys/src/libcontrol/control.c @@ -416,9 +416,9 @@ ctlparse(CParse *cp, char *s, int hasreceiver) cp->receiver = nil; for(i=0; i<cp->nargs; i++){ t = cp->args[i]; - while(*t == '[') /* %R gives [0 0] [1 1]; atoi will stop at closing ] */ + while(*t == '[') /* %R gives [0 0] [1 1]; strtol will stop at closing ] */ t++; - cp->iargs[i] = atoi(t); + cp->iargs[i] = strtol(t, 0, 0); } return cp->nargs; } diff --git a/sys/src/libcontrol/menu.c b/sys/src/libcontrol/menu.c index 56b915a4c..93c9edc98 100644 --- a/sys/src/libcontrol/menu.c +++ b/sys/src/libcontrol/menu.c @@ -238,7 +238,7 @@ menuctl(Control *c, CParse *cp) break; case EFocus: _ctlargcount(m, cp, 2); - if(atoi(cp->args[1]) == 0) + if(strtol(cp->args[1], 0, 0) == 0) menuhide(m); break; case EFont: |