summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2015-08-03 17:07:40 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2015-08-03 17:07:40 +0200
commit2ef29e10f4157b90f0f4b5ce7f3bca551231ce02 (patch)
tree7f128a0b2705431346c5bf0bcb90d87ae94d46d7 /sys
parent1b7e120c090af2f8f0e17a664ba0e5e5d7f261a0 (diff)
pc, pc64: replace atoi() calls with strtol() when hex can be expcte
Diffstat (limited to 'sys')
-rw-r--r--sys/src/9/pc/archmp.c4
-rw-r--r--sys/src/9/pc/devi82365.c2
-rw-r--r--sys/src/9/pc/etherm10g.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/sys/src/9/pc/archmp.c b/sys/src/9/pc/archmp.c
index 723433db8..6e7aa3de9 100644
--- a/sys/src/9/pc/archmp.c
+++ b/sys/src/9/pc/archmp.c
@@ -261,8 +261,8 @@ mpoverride(uchar** newp, uchar** e)
uchar* p;
char* s;
- size = atoi(getconf("*mp"));
- if(size == 0) panic("mpoverride: invalid size in *mp");
+ size = strtol(getconf("*mp"), 0, 0);
+ if(size <= 0) panic("mpoverride: invalid size in *mp");
*newp = p = xalloc(size);
if(p == nil) panic("mpoverride: can't allocate memory");
*e = p + size;
diff --git a/sys/src/9/pc/devi82365.c b/sys/src/9/pc/devi82365.c
index 0e05a6102..6defcaeb9 100644
--- a/sys/src/9/pc/devi82365.c
+++ b/sys/src/9/pc/devi82365.c
@@ -864,7 +864,7 @@ i82365write(Chan *c, void *a, long n, vlong off)
/* set vpp on card */
if(strncmp(buf, "vpp", 3) == 0)
- wrreg(pp, Rpc, vcode(atoi(buf+3))|Fautopower|Foutena|Fcardena);
+ wrreg(pp, Rpc, vcode(strtol(buf+3, 0, 0))|Fautopower|Foutena|Fcardena);
return n;
case Qmem:
case Qattr:
diff --git a/sys/src/9/pc/etherm10g.c b/sys/src/9/pc/etherm10g.c
index bceb971f8..255461d8c 100644
--- a/sys/src/9/pc/etherm10g.c
+++ b/sys/src/9/pc/etherm10g.c
@@ -356,7 +356,7 @@ whichfw(Pcidev *p)
print("m10g: %d lanes; ecrc=%d; ", lanes, ecrc);
if(s = getconf("myriforce")){
- i = atoi(s);
+ i = strtol(s, 0, 0);
if(i != 4*KiB || i != 2*KiB)
i = 2*KiB;
print("fw = %d [forced]\n", i);
@@ -390,7 +390,7 @@ parseeprom(Ctlr *c)
c->ra[k] = strtoul(s+j+3*k, 0, 16);
}else if(strncmp(s+i, "SN=", 3) == 0){
bits ^= 2;
- c->serial = atoi(s+i+3);
+ c->serial = strtoul(s+i+3, 0, 10);
}
i += l;
}