custom message type for VM_INFO
[minix3.git] / lib / libminc / atoi.c
blobbcd3450ea518d2b4886d1cc5650a8f7b6d572af2
1 /* Extracted from sys/arch/i386/stand/lib/bootmenu.c */
2 int atoi(const char *);
4 #define isnum(c) ((c) >= '0' && (c) <= '9')
6 int
7 atoi(const char *in)
9 const char *c;
10 int ret;
12 ret = 0;
13 c = in;
14 if (*c == '-')
15 c++;
16 for (; isnum(*c); c++)
17 ret = (ret * 10) + (*c - '0');
19 return (*in == '-') ? -ret : ret;