tChange _p9strsig to return nil if tmp==nil. - plan9port - [fork] Plan 9 from user space
git clone git://src.adamsgaard.dk/plan9port
Log
Files
Refs
README
LICENSE
---
commit 3a9dccd76ee6916d5586a3fba49cb8e0edb3ca5d
parent 85117729d01e8f911beef396040eb2e739e5cc65
Author: rsc 
Date:   Fri,  2 Apr 2004 22:57:49 +0000

Change _p9strsig to return nil if tmp==nil.

Add atoi, atol, atoll.
These versions call strtol/strtoll with base==0.
The Unix versions use base==10.

Diffstat:
  A src/lib9/atoi.c                     |       9 +++++++++
  A src/lib9/atol.c                     |       9 +++++++++
  A src/lib9/atoll.c                    |       9 +++++++++
  M src/lib9/await.c                    |       2 ++
  M src/lib9/mkfile                     |       3 +++

5 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/src/lib9/atoi.c b/src/lib9/atoi.c
t@@ -0,0 +1,9 @@
+#include 
+#include 
+
+int
+atoi(char *s)
+{
+        return strtol(s, 0, 0);
+}
+
diff --git a/src/lib9/atol.c b/src/lib9/atol.c
t@@ -0,0 +1,9 @@
+#include 
+#include 
+
+long
+atol(char *s)
+{
+        return strtol(s, 0, 0);
+}
+
diff --git a/src/lib9/atoll.c b/src/lib9/atoll.c
t@@ -0,0 +1,9 @@
+#include 
+#include 
+
+vlong
+atoll(char *s)
+{
+        return strtoll(s, 0, 0);
+}
+
diff --git a/src/lib9/await.c b/src/lib9/await.c
t@@ -56,6 +56,8 @@ _p9sigstr(int sig, char *tmp)
         for(i=0; i
diff --git a/src/lib9/mkfile b/src/lib9/mkfile
t@@ -72,6 +72,9 @@ LIB9OFILES=\
         announce.$O\
         argv0.$O\
         atexit.$O\
+        atoi.$O\
+        atol.$O\
+        atoll.$O\
         atnotify.$O\
         await.$O\
         cistrcmp.$O\