* lread.c (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Apr 2011 07:48:36 +0000 (00:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 4 Apr 2011 07:48:36 +0000 (00:48 -0700)
src/ChangeLog
src/lread.c

index ee95524..a83f79e 100644 (file)
@@ -2,6 +2,7 @@
 
        * lread.c (lisp_file_lexically_bound_p): Use ints rather than endptrs.
        (lisp_file_lexically_bound_p, read1): Use unsigned instead of int.
+       (safe_to_load_p): Make the end-of-loop test the inverse of the in-loop.
 
        * print.c (print_error_message): Avoid int overflow.
 
index fb5b6cd..8777bc3 100644 (file)
@@ -907,7 +907,7 @@ safe_to_load_p (int fd)
        if (i == 4)
          version = buf[i];
 
-      if (i == nbytes
+      if (i >= nbytes
          || fast_c_string_match_ignore_case (Vbytecomp_version_regexp,
                                              buf + i) < 0)
        safe_p = 0;