snprintf() doesn't use format size specifiers

Duss Pirmin pirmin at ...321...
Mon Apr 20 23:08:26 CEST 2015


Hello

If I try to format some data in a anligned string with  
Genode::snprintf(), the data is stored in the string, but my  
additional format specifier for the field width aren't respected.

My string is:

static const char* lineFormat = "%5d  \"%25s\"  \"%25s\" %10s %5d\r\n"

If I do want to right align the numbers (%-5d) the function crashes my  
program.

The comment on the functoin doesn't specify that format sizes arn't supported.

Best regards
Pirmin Duss






More information about the users mailing list