diff options
author | Nicholas Noll <nbnoll@eml.cc> | 2021-12-02 09:18:24 -0800 |
---|---|---|
committer | Nicholas Noll <nbnoll@eml.cc> | 2021-12-02 09:18:24 -0800 |
commit | f7a916f7620c749d440cb6a76010641675217689 (patch) | |
tree | a77f29c25f6143645f11cefa6f30c22daa1c6549 /src/base/string/atoi.c | |
parent | abd5a5b67e5b87a1de73761172ff51cf2f8e1213 (diff) |
many small updates
Diffstat (limited to 'src/base/string/atoi.c')
-rw-r--r-- | src/base/string/atoi.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/base/string/atoi.c b/src/base/string/atoi.c new file mode 100644 index 0000000..dba057a --- /dev/null +++ b/src/base/string/atoi.c @@ -0,0 +1,11 @@ +#include "internal.h" + +int +str·atoi(char *s) +{ + int n = 0; + while(*s) + n = 10*n + (*s++ - '0'); + + return n; +} |