URL:
  <http://savannah.nongnu.org/bugs/?32322>

                 Summary: snprintf() Hex conversion field width specifiers
malfunction
                 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

    _______________________________________________________

Details:

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>

int
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:

  <http://savannah.nongnu.org/bugs/?32322>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.nongnu.org/


_______________________________________________
AVR-libc-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-libc-dev

Reply via email to