[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <94D0CD8314A33A4D9D801C0FE68B402958C7A8A6@G9W0745.americas.hpqcorp.net>
Date: Sun, 14 Sep 2014 22:38:02 +0000
From: "Elliott, Robert (Server Storage)" <Elliott@...com>
To: Rickard Strandqvist <rickard_strandqvist@...ctrumdigital.se>
CC: "James E.J. Bottomley" <JBottomley@...allels.com>,
"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] scsi: scsi_devinfo.c: Cleaning up unnecessarily
complicated in conjunction with strncpy
> -----Original Message-----
> From: Rickard Strandqvist [mailto:rickard_strandqvist@...ctrumdigital.se]
> How do you mean?
>
> strncpy zeroes throughout the remainder of the string "from" until the
> length off to_length, or otherwise guaranteed trailing zero characters
> and a warning is printed.
>
> Is not it exactly the functionality that is desired?
Ah, I see that in man 3 strcpy:
"If the length of src is less than n, strncpy() pads the
remainder of dest with null bytes."
I agree that should work.
---
Rob Elliott HP Server Storage
Powered by blists - more mailing lists