shithub: scc

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