shithub: scc

ref: 1d263bb8b0a2b372050ec285a1306431c203542e
dir: /src/libc/stdlib/_dtoi.c/

View raw version
#include <ctype.h>
#include <limits.h>
#include <string.h>

int
_dtoi(char c)
{
	static const char digits[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
	char *p;

	if (p = strchr(digits, toupper(c)))
		return p - digits;

	return INT_MAX;
}