summaryrefslogtreecommitdiff
path: root/ulib.c
diff options
context:
space:
mode:
Diffstat (limited to 'ulib.c')
-rw-r--r--ulib.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/ulib.c b/ulib.c
index decab69..ce4e13d 100644
--- a/ulib.c
+++ b/ulib.c
@@ -88,3 +88,14 @@ stat(char *n, struct stat *st)
close(fd);
return r;
}
+
+int
+atoi(const char *s)
+{
+ int n;
+
+ n = 0;
+ while('0' <= *s && *s <= '9')
+ n = n*10 + *s++ - '0';
+ return n;
+}