From: Richard M. Stallman Date: Wed, 21 Jun 1995 19:46:58 +0000 (+0000) Subject: (scan_file): Make sure it never looks at filename[-1]. X-Git-Tag: emacs-19.34~3508 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=dc61cb9dd8c79d95f5020908b171c8482a17908a;p=emacs.git (scan_file): Make sure it never looks at filename[-1]. --- diff --git a/lib-src/make-docfile.c b/lib-src/make-docfile.c index 948a7257089..f647c21deaa 100644 --- a/lib-src/make-docfile.c +++ b/lib-src/make-docfile.c @@ -177,9 +177,9 @@ scan_file (filename) char *filename; { int len = strlen (filename); - if (!strcmp (filename + len - 4, ".elc")) + if (len > 4 && !strcmp (filename + len - 4, ".elc")) return scan_lisp_file (filename, READ_BINARY); - else if (!strcmp (filename + len - 3, ".el")) + else if (len > 3 && !strcmp (filename + len - 3, ".el")) return scan_lisp_file (filename, READ_TEXT); else return scan_c_file (filename, READ_TEXT);