git: DragonFly_RELEASE_6_4 libc: type a positional %F argument in __find_arguments()

Aaron LI aly at crater.dragonflybsd.org
Sun Sep 27 03:16:24 PDT 2026


commit 37e8817826bfd68af68173ac2a0c19ff317d08c5
Author: Showta Ishizaki <zakinko at snowrabbit.org>
Date:   Fri Sep 11 03:30:03 2026 +0900

    libc: type a positional %F argument in __find_arguments()
    
    When a format uses positional arguments, __find_arguments() walks it
    first to learn the type of every argument, and lists the floating
    point conversions as a A e E f g G.  F is missing, so a double that
    is only referred to through %F never gets a type, its slot in the
    argument table stays unset, and the conversion reads whatever is
    there:
    
        printf("[%1$F]\n", -INFINITY);   [0.000000]
        printf("[%1$F]\n", 1.5);         [0.000000]
        printf("[%F]\n", 1.5);           [1.500000]
    
    The same format with %1$f, or with any other conversion of the same
    argument, works because those give it a type.  abseil's str_format
    test compares against the C library and caught it.
    
    Add F next to f in both __find_arguments() and __find_warguments().
    
    GitHub-PR: https://github.com/DragonFlyBSD/DragonFlyBSD/pull/56

Summary of changes:
 lib/libc/stdio/printf-pos.c | 2 ++
 1 file changed, 2 insertions(+)

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/37e8817826bfd68af68173ac2a0c19ff317d08c5


-- 
DragonFly BSD source repository


More information about the Commits mailing list