This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c/37548] printf does not process correctly the (bounded) conversion specification of strings



------- Comment #1 from pinskia at gcc dot gnu dot org  2008-09-17 01:00 -------
The field width is not taken into account if there is more than that width. 
You also need to specify the precision.
  printf("\n  the 4 leftmost characters of xyz are: \"%.4s\"\n\n",xyz);

Will work.  Note the "." there.


-- 

pinskia at gcc dot gnu dot org changed:

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


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]