From: Bart Van Assche <bvanassche@acm.org>
To: target-devel@vger.kernel.org
Subject: Re: [PATCH v4 4/7] target: consistently null-terminate t10_wwn.revision
Date: Thu, 29 Nov 2018 16:28:37 +0000 [thread overview]
Message-ID: <1543508917.185366.124.camel@acm.org> (raw)
In-Reply-To: <20181129010157.12687-5-ddiss@suse.de>
On Thu, 2018-11-29 at 02:01 +-0100, David Disseldorp wrote:
+AD4 strncpy(+ACY-dev-+AD4-t10+AF8-wwn.revision+AFs-0+AF0,
+AD4 - dev-+AD4-transport-+AD4-inquiry+AF8-rev, 4)+ADs
+AD4 +- dev-+AD4-transport-+AD4-inquiry+AF8-rev, INQUIRY+AF8-REVISION+AF8-LEN)+ADs
+AD4 +- dev-+AD4-t10+AF8-wwn.revision+AFs-INQUIRY+AF8-REVISION+AF8-LEN+AF0 +AD0 '+AFw-0'+ADs
Can the above two statements be changed into a single strlcpy() call?
+AD4 - memcpy(+ACY-wwn-+AD4-revision+AFs-0+AF0, +ACY-buf+AFs-32+AF0, sizeof(wwn-+AD4-revision))+ADs
+AD4 +- memcpy(+ACY-wwn-+AD4-revision+AFs-0+AF0, +ACY-buf+AFs-32+AF0, INQUIRY+AF8-REVISION+AF8-LEN)+ADs
+AD4 +- wwn-+AD4-revision+AFs-INQUIRY+AF8-REVISION+AF8-LEN+AF0 +AD0 '+AFw-0'+ADs
Have you considered to use snprintf(..., +ACIAJQ.+ACo-s+ACI, ...) instead?
Thanks,
Bart.
prev parent reply other threads:[~2018-11-29 16:28 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-29 1:01 [PATCH v4 4/7] target: consistently null-terminate t10_wwn.revision David Disseldorp
2018-11-29 1:18 ` Ly, Bryant
2018-11-29 1:28 ` Lee Duncan
2018-11-29 16:28 ` Bart Van Assche [this message]
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=1543508917.185366.124.camel@acm.org \
--to=bvanassche@acm.org \
--cc=target-devel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.