changeset 19416:719fd5370c3e

(Fchar_before): Do range check before decrement.
author Richard M. Stallman <rms@gnu.org>
date Mon, 18 Aug 1997 18:56:07 +0000
parents 309b9a0d8a45
children d87f6112e034
files src/editfns.c
diffstat 1 files changed, 3 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Mon Aug 18 11:19:17 1997 +0000
+++ b/src/editfns.c	Mon Aug 18 18:56:07 1997 +0000
@@ -610,18 +610,17 @@
       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;