From: Stefan Weil Date: Sat, 7 Mar 2015 22:16:21 +0000 (+0100) Subject: block/qapi: Fix Sparse warning X-Git-Tag: v2.3.0-rc1~9^2~15 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=2c20fa2cc26fd203a1260bb5251a523320faa905;p=qemu-xen-unstable.git block/qapi: Fix Sparse warning Sparse reports this warning: block/qapi.c:417:47: warning: too long initializer-string for array of char(no space for nul char) Replacing the string by an array of characters fixes this warning. Signed-off-by: Stefan Weil Signed-off-by: Michael Tokarev --- diff --git a/block/qapi.c b/block/qapi.c index 1808e67336..8a19aed446 100644 --- a/block/qapi.c +++ b/block/qapi.c @@ -414,7 +414,7 @@ BlockStatsList *qmp_query_blockstats(bool has_query_nodes, static char *get_human_readable_size(char *buf, int buf_size, int64_t size) { - static const char suffixes[NB_SUFFIXES] = "KMGT"; + static const char suffixes[NB_SUFFIXES] = {'K', 'M', 'G', 'T'}; int64_t base; int i;