changeset 20925:f61425242f70

(Fchar_before): Check POS in valid range before calling CHAR_TO_BYTE.
author Karl Heuer <kwzh@gnu.org>
date Wed, 18 Feb 1998 22:56:25 +0000
parents eda7e44ef9d9
children b304072b893c
files src/editfns.c
diffstat 1 files changed, 2 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/editfns.c	Wed Feb 18 22:54:43 1998 +0000
+++ b/src/editfns.c	Wed Feb 18 22:56:25 1998 +0000
@@ -589,6 +589,8 @@
     pos_byte = PT_BYTE;
   else if (MARKERP (pos))
     pos_byte = marker_byte_position (pos);
+  else if (pos <= BEGV || pos > ZV)
+    return Qnil;
   else
     {
       CHECK_NUMBER_COERCE_MARKER (pos, 0);
@@ -596,9 +598,6 @@
       pos_byte = CHAR_TO_BYTE (XINT (pos));
     }
 
-  if (pos_byte <= BEGV_BYTE || pos_byte > ZV_BYTE)
-    return Qnil;
-
   if (!NILP (current_buffer->enable_multibyte_characters))
     {
       DEC_POS (pos_byte);