shithub: scc

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