public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/11923] New: sprintf - %#02x doesnt expand to 0x00 if the value 0 is used
@ 2010-08-18 13:27 almrobert at gmail dot com
  2010-08-18 13:37 ` [Bug libc/11923] " almrobert at gmail dot com
  2010-08-18 14:21 ` schwab at linux-m68k dot org
  0 siblings, 2 replies; 4+ messages in thread
From: almrobert at gmail dot com @ 2010-08-18 13:27 UTC (permalink / raw)
  To: glibc-bugs

First of all, I have libc.2.11, running Ubuntu 10.04 with GCC (gcc (Ubuntu 
4.4.3-4ubuntu5) 4.4.3). I suppose this is the correct libc.... I have not tested 
the latest source of libc. 

Running the following example code:

#include <stdio.h>
#include <stdlib.h>

#define TEST_SPRINTF "asdf.%#08x.%#02x.%#04x.%#02x.asdf"
#define TEST_SPRINTF2 "asdf.0x%08x.0x%02x.0x%04x.0x%02x.asdf"

int main(void) {
    char test[128];
    unsigned int value1 = 0x12345678;
    int value2 = 0x00;
    int value3 = 0x0012;
    int value4 = 0x1234;

    sprintf(test, TEST_SPRINTF, value1, value2, value3, value4);
    printf("%s\n", test);
    sprintf(test, TEST_SPRINTF2, value1, value2, value3, value4);
    printf("%s\n", test);


	return EXIT_SUCCESS;
}

Gives the following output:

asdf.0x12345678.00.0x12.0x1234.asdf
asdf.0x12345678.0x00.0x0012.0x1234.asdf

The second row is as supposed to while the first row is missing 0x and 00

-- 
           Summary: sprintf - %#02x doesnt expand to 0x00 if the value 0 is
                    used
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: almrobert at gmail dot com
                CC: glibc-bugs at sources dot redhat dot com


http://sourceware.org/bugzilla/show_bug.cgi?id=11923

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11923] sprintf - %#02x doesnt expand to 0x00 if the value 0 is used
  2010-08-18 13:27 [Bug libc/11923] New: sprintf - %#02x doesnt expand to 0x00 if the value 0 is used almrobert at gmail dot com
@ 2010-08-18 13:37 ` almrobert at gmail dot com
  2010-08-18 14:21 ` schwab at linux-m68k dot org
  1 sibling, 0 replies; 4+ messages in thread
From: almrobert at gmail dot com @ 2010-08-18 13:37 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|unspecified                 |2.11


http://sourceware.org/bugzilla/show_bug.cgi?id=11923

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11923] sprintf - %#02x doesnt expand to 0x00 if the value 0 is used
  2010-08-18 13:27 [Bug libc/11923] New: sprintf - %#02x doesnt expand to 0x00 if the value 0 is used almrobert at gmail dot com
  2010-08-18 13:37 ` [Bug libc/11923] " almrobert at gmail dot com
@ 2010-08-18 14:21 ` schwab at linux-m68k dot org
  1 sibling, 0 replies; 4+ messages in thread
From: schwab at linux-m68k dot org @ 2010-08-18 14:21 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From schwab at linux-m68k dot org  2010-08-18 14:20 -------
That's how it is supposed to be.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |INVALID


http://sourceware.org/bugzilla/show_bug.cgi?id=11923

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/11923] sprintf - %#02x doesnt expand to 0x00 if the value 0 is used
       [not found] <bug-11923-131@http.sourceware.org/bugzilla/>
@ 2014-06-30  8:16 ` fweimer at redhat dot com
  0 siblings, 0 replies; 4+ messages in thread
From: fweimer at redhat dot com @ 2014-06-30  8:16 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=11923

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-30  8:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-18 13:27 [Bug libc/11923] New: sprintf - %#02x doesnt expand to 0x00 if the value 0 is used almrobert at gmail dot com
2010-08-18 13:37 ` [Bug libc/11923] " almrobert at gmail dot com
2010-08-18 14:21 ` schwab at linux-m68k dot org
     [not found] <bug-11923-131@http.sourceware.org/bugzilla/>
2014-06-30  8:16 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).