diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-03 16:24:14 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-03 16:24:14 +0200 |
commit | 1b7e120c090af2f8f0e17a664ba0e5e5d7f261a0 (patch) | |
tree | ffb4172f0b632a49e4eaab6475275b2ed53d9fad /sys/src | |
parent | 887ae1a17b54babf6a0946872bf6faaac1427be1 (diff) |
kernel: dont rely on atoi() parsing hex for netif/devbridge
Diffstat (limited to 'sys/src')
-rw-r--r-- | sys/src/9/port/devbridge.c | 4 | ||||
-rw-r--r-- | sys/src/9/port/netif.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/sys/src/9/port/devbridge.c b/sys/src/9/port/devbridge.c index fd0b7a45e..baffc70e2 100644 --- a/sys/src/9/port/devbridge.c +++ b/sys/src/9/port/devbridge.c @@ -537,7 +537,7 @@ portbind(Bridge *b, int argc, char *argv[]) dev2 = argv[4]; } else error(usage); - ownhash = atoi(argv[2]); + ownhash = strtoul(argv[2], 0, 0); dev = argv[3]; for(i=0; i<b->nport; i++) { port = b->port[i]; @@ -643,7 +643,7 @@ portunbind(Bridge *b, int argc, char *argv[]) } else error(usage); if(argc == 3) - ownhash = atoi(argv[2]); + ownhash = strtoul(argv[2], 0, 0); else ownhash = 0; for(i=0; i<b->nport; i++) { diff --git a/sys/src/9/port/netif.c b/sys/src/9/port/netif.c index 9df9e40a4..4b818938e 100644 --- a/sys/src/9/port/netif.c +++ b/sys/src/9/port/netif.c @@ -308,7 +308,7 @@ netifwrite(Netif *nif, Chan *c, void *a, long n) qlock(nif); f = nif->f[NETID(c->qid.path)]; if((p = matchtoken(buf, "connect")) != 0){ - type = atoi(p); + type = strtoul(p, 0, 0); if(typeinuse(nif, type)) error(Einuse); f->type = type; |