qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: wei.yang@ucloud.cn
To: mst@redhat.com
Cc: qemu-devel@nongnu.org, wei.yang@ucloud.cn
Subject: [Qemu-devel] [PATCH] bios-tables-test: use strlen instead of sizeof
Date: Tue, 15 Aug 2017 13:04:14 +0800	[thread overview]
Message-ID: <20170815050414.29222-1-wei.yang@ucloud.cn> (raw)

From: Wei Yang <wei.yang@ucloud.cn>

sizeof(BLOCK_NAME_END) is actually 2.  it can work
because there's a space after ,. but It is better to
replace it with strlen so it will work without a space too.

Signed-off-by: Wei Yang <wei.yang@ucloud.cn>
CC: Michael S. Tsirkin <mst@redhat.com>
CC: qemu-devel@nongnu.org
---
 tests/bios-tables-test.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/bios-tables-test.c b/tests/bios-tables-test.c
index 88dbf97853..d1f31b19d3 100644
--- a/tests/bios-tables-test.c
+++ b/tests/bios-tables-test.c
@@ -352,7 +352,7 @@ static GString *normalize_asl(gchar *asl_code)
         block_name = g_strstr_len(asl->str, asl->len, BLOCK_NAME_END);
         g_assert(block_name);
         asl = g_string_erase(asl, 0,
-                             block_name + sizeof(BLOCK_NAME_END) - asl->str);
+                             block_name + strlen(BLOCK_NAME_END) - asl->str);
     }
 
     return asl;
-- 
2.11.0

                 reply	other threads:[~2017-08-15  5:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20170815050414.29222-1-wei.yang@ucloud.cn \
    --to=wei.yang@ucloud.cn \
    --cc=mst@redhat.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).