[Bug c/16492] New: sprintf

aotto1968 at onlinehome dot de gcc-bugzilla@gcc.gnu.org
Mon Jul 12 12:08:00 GMT 2004


#include <stdio.h> 
 
int main (void) 
{ 
    char str[11]; 
    snprintf(str, 10, "%10p", 0x12345678); 
    str[10] = '\0'; 
    printf("%s\n", str); 
} 
 
>> OUTPUT: 0x1234567 
>> SHOULD: 0x12345678

-- 
           Summary: sprintf
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: aotto1968 at onlinehome dot de
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i586-suse-linux
  GCC host triplet: i586-suse-linux
GCC target triplet: i586-suse-linux


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16492



More information about the Gcc-bugs mailing list