Commit 20713324 authored by Richard M. Stallman's avatar Richard M. Stallman

(Fchar_before): Do range check before decrement.

parent af4fecb4
......@@ -610,18 +610,17 @@ is returned as a character.")
n = XINT (pos);
}
if (n <= BEGV || n > ZV)
return Qnil;
if (!NILP (current_buffer->enable_multibyte_characters))
{
DEC_POS (n);
if (n < BEGV || n >= ZV)
return Qnil;
XSETFASTINT (val, FETCH_CHAR (n));
}
else
{
n--;
if (n < BEGV || n >= ZV)
return Qnil;
XSETFASTINT (val, FETCH_BYTE (n));
}
return val;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment