[syslinux] [PATCH] Make com32 printf obey width-restriction on %s

Maurice Massar massar at unix-ag.uni-kl.de
Fri Apr 13 08:18:09 PDT 2007


hi,

On Thu, Apr 12, 2007 at 12:59:46PM +0200, Arne Georg Gleditsch wrote:
> The following patch is against 3.36.  It lets the width-modifier to the
> %s conversion specifier restrict the length of the formatted string as
> well as expand it.

The field width specifies the minimum field width:
"In no case does a [..] small field width cause truncation of a field;"

If you want to restrict the length, specify a precision, like:
"%.10s", which will print a most 10 characters.

see:
man 3 printf
http://www.die.net/doc/linux/man/man3/printf.3.html

cu
maurice




More information about the Syslinux mailing list