Re: [PATCH] scsi_devinfo: cleanly zero-pad devinfo strings

2017-12-04 Thread Martin K. Petersen
Martin, > Cleanly fill memory for "vendor" and "model" with 0-bytes for the > "compatible" case rather than adding only a single 0 byte. This > simplifies the devinfo code a a bit, and avoids mistakes in other > places of the code (not in current upstream, but we had one such > mistake in the SU

Re: [PATCH] scsi_devinfo: cleanly zero-pad devinfo strings

2017-11-28 Thread Bart Van Assche
On Mon, 2017-11-27 at 23:47 +0100, Martin Wilck wrote: > + /* This zero-pads the destination */ > + strncpy(to, from, to_length); > + if (from_length < to_length && !compatible) > + /* > + * space pad the string if it is short. > + */ > +

[PATCH] scsi_devinfo: cleanly zero-pad devinfo strings

2017-11-27 Thread Martin Wilck
Cleanly fill memory for "vendor" and "model" with 0-bytes for the "compatible" case rather than adding only a single 0 byte. This simplifies the devinfo code a a bit, and avoids mistakes in other places of the code (not in current upstream, but we had one such mistake in the SUSE kernel). Signed-o