aboutsummaryrefslogtreecommitdiff
path: root/block/blkdebug.c
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2018-07-27 08:22:04 +0200
committerMarkus Armbruster <armbru@redhat.com>2018-07-28 09:09:58 +0200
commitba891d68b4ff17faaea3d3a8bfd82af3eed0a134 (patch)
treea60591188270f2ec5ade8eef780b26da5ddf0efd /block/blkdebug.c
parentb65ab77b3afadd7bb3051b341a5258ff7fb9d246 (diff)
downloadqemu-ba891d68b4ff17faaea3d3a8bfd82af3eed0a134.zip
qemu-ba891d68b4ff17faaea3d3a8bfd82af3eed0a134.tar.gz
qemu-ba891d68b4ff17faaea3d3a8bfd82af3eed0a134.tar.bz2
qstring: Move qstring_from_substr()'s @end one to the right
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> Reviewed-by: Eric Blake <eblake@redhat.com> Message-Id: <20180727062204.10401-3-armbru@redhat.com>
Diffstat (limited to 'block/blkdebug.c')
-rw-r--r--block/blkdebug.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/block/blkdebug.c b/block/blkdebug.c
index 0457bf5..0759452 100644
--- a/block/blkdebug.c
+++ b/block/blkdebug.c
@@ -305,7 +305,7 @@ static void blkdebug_parse_filename(const char *filename, QDict *options,
if (c != filename) {
QString *config_path;
- config_path = qstring_from_substr(filename, 0, c - filename - 1);
+ config_path = qstring_from_substr(filename, 0, c - filename);
qdict_put(options, "config", config_path);
}