# HG changeset patch # User Richard M. Stallman # Date 1127499766 0 # Node ID 71ea8ba70056021e34c1b7b598349765c91f9924 # Parent 5bde6d4759d61fc00fc5d81be783af882395679e (Fformat): Explicitly test for end of format string and don't use `index'. diff -r 5bde6d4759d6 -r 71ea8ba70056 src/editfns.c --- a/src/editfns.c Fri Sep 23 18:15:20 2005 +0000 +++ b/src/editfns.c Fri Sep 23 18:22:46 2005 +0000 @@ -3424,7 +3424,9 @@ 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')