diff --git a/baseconv.c b/baseconv.c index 33ecad4..5ec5e3d 100644 --- a/baseconv.c +++ b/baseconv.c @@ -9,7 +9,7 @@ static const char digits[] = "0123456789abcdefghijklmnopqrstuvwxyz"; bool baseconv(char outbuf[], size_t bufsize, unsigned base, uintmax_t num) { // Supported bases are 2 to 36 inclusive (though it could be higher // if our digits string was longer - if (base < 2 || base > 36) + if (base < 2 || base > sizeof(digits)) return false; // Longest possible converted string is base-2, where we produce one