define atoi as strtol for everybody - vx32 - Local 9vx git repository for patches.
Log
Files
Refs
---
commit 9f367c3963f9cae20bc9119b718ce595608b7bd3
parent 321d124f7cf6baa3e051aa5162e09b0f1af1afb9
Author: Jesus Galan Lopez (yiyus) 
Date:   Sun, 13 Jun 2010 18:06:19 +0200

define atoi as strtol for everybody

Diffstat:
  src/9vx/a/netif.c                   |       2 +-
  src/9vx/u.h                         |       1 +

2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/9vx/a/netif.c b/src/9vx/a/netif.c
@@ -341,7 +341,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){
-                sscanf(p, "%x", &type);
+                type = atoi(p);
                 if(typeinuse(nif, type))
                         error(Einuse);
                 f->type = type;
diff --git a/src/9vx/u.h b/src/9vx/u.h
@@ -17,3 +17,4 @@ typedef int socklen_t;
 #define nil ((void*)0)
 #define sleep _ksleep
 #define syscall _ksyscall
+#define atoi(x) strtol(x, 0, 0)