From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>,
linux-scsi <linux-scsi@vger.kernel.org>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
mpi3mr-drvr-developers <mpi3mr-linuxdrv.pdl@broadcom.com>,
Kashyap Desai <kashyap.desai@broadcom.com>,
Sathya Prakash Veerichetty <sathya.prakash@broadcom.com>,
kernel test robot <lkp@intel.com>
Subject: Re: [PATCH v2] mpi3mr: Fix W=1 compilation warnings
Date: Tue, 06 Jul 2021 14:39:19 -0400 [thread overview]
Message-ID: <yq1lf6je1fa.fsf@ca-mkp.ca.oracle.com> (raw)
In-Reply-To: <CAK=zhgrV4BwY2VzhGN=BbFj_2DutUUnD+33dmGqbN_ivz4-0Xg@mail.gmail.com> (Sreekanth Reddy's message of "Sun, 4 Jul 2021 22:39:37 +0530")
Sreekanth,
> I verified strscpy() is not adding any null terminator when source
> string length is greater than destination buffer size.
That's odd. The point of strscpy() is that it guarantees termination:
---8<---
/**
* strscpy - Copy a C-string into a sized buffer
* @dest: Where to copy the string to
* @src: Where to copy the string from
* @count: Size of destination buffer
*
* Copy the string, or as much of it as fits, into the dest buffer. The
* behavior is undefined if the string buffers overlap. The destination
* buffer is always NUL terminated, unless it's zero-sized.
---8<---
I tested it and it works fine for me.
--
Martin K. Petersen Oracle Linux Engineering
next prev parent reply other threads:[~2021-07-06 18:39 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-29 14:11 [PATCH v2] mpi3mr: Fix W=1 compilation warnings Sreekanth Reddy
2021-06-29 20:35 ` Martin K. Petersen
2021-07-04 17:09 ` Sreekanth Reddy
2021-07-06 18:39 ` Martin K. Petersen [this message]
2021-07-07 5:53 ` Sreekanth Reddy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=yq1lf6je1fa.fsf@ca-mkp.ca.oracle.com \
--to=martin.petersen@oracle.com \
--cc=jejb@linux.ibm.com \
--cc=kashyap.desai@broadcom.com \
--cc=linux-scsi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mpi3mr-linuxdrv.pdl@broadcom.com \
--cc=sathya.prakash@broadcom.com \
--cc=sreekanth.reddy@broadcom.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox