lkml.org 
[lkml]   [2021]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v1 1/1] s390: Use string_upper() instead of open coded variant
Date
...
> > + * This snprintf() call does two things:
> > + * - makes a NUL-terminated copy of the input string
> > + * - pads it with spaces
> > + */
> > + snprintf(tmp, sizeof(tmp), "%s ", name);
>
> I can't say I like code where I have to count spaces in order to
> verify if the code is actually correct.

What it wrong with "%-8.8s" ?

David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

\
 
 \ /
  Last update: 2021-10-11 10:22    [W:0.112 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site