wm: teppich

ref: 10784c7106b0538ad853c421daf33c0d6597ff5d
dir: /libc/atoi.c/

View raw version
#include <u.h>
#include <libc.h>

/* doesn't handle - */
int
atoi(char *s)
{
	int n = 0;
	while(*s > '9' || *s < '0')
	{
		n += *s - '0';
	}
	return n;
}