[Bug c/37548] New: printf does not process correctly the (bounded) conversion specification of strings
paulo dot nogueira at ist dot utl dot pt
gcc-bugzilla@gcc.gnu.org
Wed Sep 17 00:41:00 GMT 2008
The C program below prints the full string "xyz" both times. I am using
GNU C version 4.1.2 20070925 (Red Hat 4.1.2-27) (x86_64-redhat-linux)
compiled by GNU C version 4.1.2 20070925 (Red Hat 4.1.2-27).
-----------------------------------------------------------------------
#include <stdio.h>
#include <string.h>
int main ( void )
{
char xyz[256];
strcpy(xyz,"a not so random string");
printf("\n the string xyz is: \"%s\"\n\n",xyz);
printf("\n the 4 leftmost characters of xyz are: \"%4s\"\n\n",xyz);
return 0;
}
--
Summary: printf does not process correctly the (bounded)
conversion specification of strings
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: paulo dot nogueira at ist dot utl dot pt
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37548
More information about the Gcc-bugs
mailing list