From dc61cb9dd8c79d95f5020908b171c8482a17908a Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 21 Jun 1995 19:46:58 +0000 Subject: [PATCH] (scan_file): Make sure it never looks at filename[-1]. --- lib-src/make-docfile.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.39.2