From 20713324f5dd5ea000b99a46e70b4378a1521f2b Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Mon, 18 Aug 1997 18:56:07 +0000 Subject: [PATCH] (Fchar_before): Do range check before decrement. --- src/editfns.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/editfns.c b/src/editfns.c index c8a6506e493..c12ea5ac3bb 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -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; -- 2.39.2