remove skeleton file
[ascii.git] / atoi.c
CommitLineData
1968fc94
LM
1#include "atoi.h"
2
3int atoi (char *str)
4{
5 int i = 0;
6 int s = 1;
7
8 if (*str == '-') {
9 s = 0;
e9b24fd1 10 str++;
1968fc94
LM
11 }
12
13 while (*str != 0) {
14 if ((*str <'0') || (*str > '9')) {
15 return 0;
16 }
17 i = i * 10 + (int)(*(str++) - '0');
18 }
19
20 return (s) ? i : -i;
21}
22
e9b24fd1 23/* vim: set ts=4 sw=4 et: */