From: Richard M. Stallman Date: Mon, 18 Aug 1997 18:56:07 +0000 (+0000) Subject: (Fchar_before): Do range check before decrement. X-Git-Tag: emacs-20.1~532 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=20713324f5dd5ea000b99a46e70b4378a1521f2b;p=emacs.git (Fchar_before): Do range check before decrement. --- 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;