From ba891d68b4ff17faaea3d3a8bfd82af3eed0a134 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 27 Jul 2018 08:22:04 +0200 Subject: 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 Reviewed-by: Eric Blake Message-Id: <20180727062204.10401-3-armbru@redhat.com> --- tests/check-qstring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/check-qstring.c') diff --git a/tests/check-qstring.c b/tests/check-qstring.c index f11a7a8605..2d079921e3 100644 --- a/tests/check-qstring.c +++ b/tests/check-qstring.c @@ -66,7 +66,7 @@ static void qstring_from_substr_test(void) { QString *qs; - qs = qstring_from_substr("virtualization", 3, 9); + qs = qstring_from_substr("virtualization", 3, 10); g_assert(qs != NULL); g_assert(strcmp(qstring_get_str(qs), "tualiza") == 0); -- cgit v1.2.3