projects
/
unix-history
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7ce1c4b
)
BSD 3 development
author
Bill Joy
<wnj@ucbvax.Berkeley.EDU>
Fri, 4 Jan 1980 10:28:11 +0000
(
02:28
-0800)
committer
Bill Joy
<wnj@ucbvax.Berkeley.EDU>
Fri, 4 Jan 1980 10:28:11 +0000
(
02:28
-0800)
Work on file usr/src/libc/gen/atoi.c
Synthesized-from: 3bsd
usr/src/libc/gen/atoi.c
[new file with mode: 0644]
patch
|
blob
diff --git a/usr/src/libc/gen/atoi.c
b/usr/src/libc/gen/atoi.c
new file mode 100644
(file)
index 0000000..
9088178
--- /dev/null
+++ b/
usr/src/libc/gen/atoi.c
@@ -0,0
+1,24
@@
+atoi(ap)
+char *ap;
+{
+ register int n, c;
+ register char *p;
+ int f;
+
+ p = ap;
+ n = 0;
+ f = 0;
+loop:
+ while(*p == ' ' || *p == ' ')
+ p++;
+ if(*p == '-') {
+ f++;
+ p++;
+ goto loop;
+ }
+ while(*p >= '0' && *p <= '9')
+ n = n*10 + *p++ - '0';
+ if(f)
+ n = -n;
+ return(n);
+}