From: Eric Blake <eblake@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, qemu-devel@nongnu.org
Cc: liujunjie23@huawei.com
Subject: Re: [Qemu-devel] [PATCH 2/2] qstring: Move qstring_from_substr()'s @end one to the right
Date: Thu, 26 Jul 2018 09:07:28 -0500 [thread overview]
Message-ID: <23467af9-5ded-ee63-5408-b95c00ac48f7@redhat.com> (raw)
In-Reply-To: <20180726061844.25992-3-armbru@redhat.com>
On 07/26/2018 01:18 AM, Markus Armbruster wrote:
> qstring_from_substr() takes the index of the substring's first and
> last character. qstring_from_substr(s, 0, SIZE_MAX) denotes an empty
> substring. Awkward.
>
> Shift the end index one to the right. This simplifies both
> qstring_from_substr() and its callers.
>
> Signed-off-by: Markus Armbruster <armbru@redhat.com>
> ---
Not strictly a bug fix, but found while fixing a bug, thus I'm okay if
this makes it into 3.0 (your call as maintainer).
> block/blkdebug.c | 2 +-
> block/blkverify.c | 2 +-
> block/nbd.c | 2 +-
> qobject/qstring.c | 6 +++---
> tests/check-qobject.c | 2 +-
> tests/check-qstring.c | 2 +-
> 6 files changed, 8 insertions(+), 8 deletions(-)
>
This does fix all users.
Reviewed-by: Eric Blake <eblake@redhat.com>
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3266
Virtualization: qemu.org | libvirt.org
prev parent reply other threads:[~2018-07-26 14:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-26 6:18 [Qemu-devel] [PATCH 0/2] qstring: Safer qstring_from_substr() Markus Armbruster
2018-07-26 6:18 ` [Qemu-devel] [PATCH 1/2] qstring: Assert size calculations don't overflow Markus Armbruster
2018-07-26 14:04 ` Eric Blake
2018-07-26 17:27 ` Markus Armbruster
2018-07-26 6:18 ` [Qemu-devel] [PATCH 2/2] qstring: Move qstring_from_substr()'s @end one to the right Markus Armbruster
2018-07-26 14:07 ` Eric Blake [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=23467af9-5ded-ee63-5408-b95c00ac48f7@redhat.com \
--to=eblake@redhat.com \
--cc=armbru@redhat.com \
--cc=liujunjie23@huawei.com \
--cc=qemu-devel@nongnu.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).