From 913f73d4ee958218c5ce3b5a3957bee4f844f124 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Fri, 23 Sep 2005 18:22:46 +0000 Subject: [PATCH] (Fformat): Explicitly test for end of format string and don't use `index'. --- src/editfns.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/editfns.c b/src/editfns.c index c8b02570c12..ee1249acc11 100644 --- a/src/editfns.c +++ b/src/editfns.c @@ -3424,7 +3424,9 @@ usage: (format STRING &rest OBJECTS) */) digits to print after the '.' for floats, or the max. number of chars to print from a string. */ - while (*format && index ("-0# ", *format)) + while (format != end + && (*format == '-' || *format == '0' || *format == '#' + || * format == ' ')) ++format; if (*format >= '0' && *format <= '9') -- 2.39.2