[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PULL 09/24] block/qapi: Fix Sparse warning

From: Michael Tokarev
Subject: [Qemu-devel] [PULL 09/24] block/qapi: Fix Sparse warning
Date: Thu, 19 Mar 2015 12:05:27 +0300

From: Stefan Weil <address@hidden>

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 <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
 block/qapi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/qapi.c b/block/qapi.c
index 1808e67..8a19aed 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;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]