diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-03 14:24:29 +0200 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2015-08-03 14:24:29 +0200 |
commit | fc77a2d3d384c1ee854deebd4f1a97e751d7eaa2 (patch) | |
tree | 190b2900eefc85096deb51e2ae0d71475dad6d41 /sys/src/cmd/aux/vga/main.c | |
parent | d5d6724805fa7df9cb74d9b05a4eb3bf10d1997c (diff) |
aux/vga: dont rely on atoi() being able to parse hex
Diffstat (limited to 'sys/src/cmd/aux/vga/main.c')
-rw-r--r-- | sys/src/cmd/aux/vga/main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/src/cmd/aux/vga/main.c b/sys/src/cmd/aux/vga/main.c index 2e0431103..a3915d2ae 100644 --- a/sys/src/cmd/aux/vga/main.c +++ b/sys/src/cmd/aux/vga/main.c @@ -120,7 +120,7 @@ linear(Vga* vga) * to set up a new one. */ vgactlr("addr", buf); - if(atoi(buf)==0 && (buf[0]!='p' || buf[1]!=' ' || atoi(buf+2)==0)){ + if(strtoul(buf, 0, 0)==0 && (buf[0]!='p' || buf[1]!=' ' || strtoul(buf+2, 0, 0)==0)){ sprint(buf, "0x%lux 0x%lux", vga->apz ? vga->apz : vga->vmz, vga->vma); vgactlw("linear", buf); vgactlr("addr", buf); |