emacs-pretest-bug
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fformat fails to detect premature end of string


From: Kim F. Storm
Subject: Re: Fformat fails to detect premature end of string
Date: Tue, 20 Sep 2005 10:02:35 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

"Richard M. Stallman" <address@hidden> writes:

> Does this change fix it?

I think so, but I already installed a simpler fix -- just testing that
*format is non-NUL (as strings are NUL-terminated).

Surely, this is not a generic solution to finding the end of a string
(if string contains other NUL's), but for the specific case it is ok,
since %<NUL> is not a valid format specifier, and Fformat signals an
error for an invalid format string.

>
> *** editfns.c 12 Sep 2005 11:26:22 -0400      1.397
> --- editfns.c 19 Sep 2005 15:28:50 -0400      
> ***************
> *** 3424,3430 ****
>          digits to print after the '.' for floats, or the max.
>          number of chars to print from a string.  */
>   
> !     while (index ("-0# ", *format))
>         ++format;
>   
>       if (*format >= '0' && *format <= '9')
> --- 3424,3432 ----
>          digits to print after the '.' for floats, or the max.
>          number of chars to print from a string.  */
>   
> !     while (format != end
> !            && (*format == '-' || *format == '0' || *format == '#'
> !                || * format == ' '))
>         ++format;
>   
>       if (*format >= '0' && *format <= '9')
>
>
> _______________________________________________
> Emacs-pretest-bug mailing list
> address@hidden
> http://lists.gnu.org/mailman/listinfo/emacs-pretest-bug
>
>

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

[Prev in Thread] Current Thread [Next in Thread]