wm: teppich

ref: d94edd4b9a13e1ead5782c72753f3a6b5b02f2a6
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;
}