return digit < base ? digit : -1;
}
-/* Size of the fixed-size buffer used during reading.
- It should be at least big enough for `invalid_radix_integer' but
- can usefully be much bigger than that. */
-enum { stackbufsize = 1024 };
-
static void
-invalid_radix_integer (EMACS_INT radix, char stackbuf[VLA_ELEMS (stackbufsize)],
- Lisp_Object readcharfun)
+invalid_radix_integer (EMACS_INT radix, Lisp_Object readcharfun)
{
- int n = snprintf (stackbuf, stackbufsize, "integer, radix %"pI"d", radix);
- eassert (n < stackbufsize);
- invalid_syntax (stackbuf, readcharfun);
+ char buf[64];
+ int n = snprintf (buf, sizeof buf, "integer, radix %"pI"d", radix);
+ eassert (n < sizeof buf);
+ invalid_syntax (buf, readcharfun);
}
+/* Size of the fixed-size buffer used during reading. */
+enum { stackbufsize = 1024 };
+
/* Read an integer in radix RADIX using READCHARFUN to read
characters. RADIX must be in the interval [2..36]. Use STACKBUF
for temporary storage as needed. Value is the integer read.
UNREAD (c);
if (valid != 1)
- invalid_radix_integer (radix, stackbuf, readcharfun);
+ invalid_radix_integer (radix, readcharfun);
*p = '\0';
return unbind_to (count, string_to_number (read_buffer, radix, NULL));
{
/* #NrDIGITS -- radix-N number */
if (n < 0 || n > 36)
- invalid_radix_integer (n, stackbuf, readcharfun);
+ invalid_radix_integer (n, readcharfun);
obj = read_integer (readcharfun, n, stackbuf);
break;
}