shithub: scc

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