[Top][All Lists]

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

[avr-libc-dev] [bug #32322] snprintf() Hex conversion field width specif

From: Rick M
Subject: [avr-libc-dev] [bug #32322] snprintf() Hex conversion field width specifiers malfunction
Date: Tue, 01 Feb 2011 23:29:27 +0000
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_6; en-us) AppleWebKit/533.19.4 (KHTML, like Gecko) Version/5.0.3 Safari/533.19.4


                 Summary: snprintf() Hex conversion field width specifiers
                 Project: AVR C Runtime Library
            Submitted by: rmann
            Submitted on: Tue 01 Feb 2011 11:29:26 PM GMT
                Category: Library
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: libc code
                  Status: None
        Percent Complete: 0%
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any
                 Release: 1.6.7
           Fixed Release: None



There are numerous errors around the minimum field with specifier and padding
with leading zeros. The test case below is the result of using the
floating-point (full) version 
of the printf code.

#include <stdio.h>

main(int argc, const char** argv)
    char        buf[128];
    snprintf(buf, "%#02x", 0);          //  Writes "00"
    snprintf(buf, "%#02x", 1);          //  Writes "0x1"
    snprintf(buf, "%#02x", 0xb1);       //  Writes "0xb1"
    return 0;


Reply to this item at:


  Message sent via/by Savannah

reply via email to

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