]> Git Repo - qemu.git/commitdiff
block/qapi: Fix Sparse warning
authorStefan Weil <[email protected]>
Sat, 7 Mar 2015 22:16:21 +0000 (23:16 +0100)
committerMichael Tokarev <[email protected]>
Thu, 19 Mar 2015 08:11:55 +0000 (11:11 +0300)
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 <[email protected]>
Signed-off-by: Michael Tokarev <[email protected]>
block/qapi.c

index 1808e67336af161b868896d2d99f31badce8fa37..8a19aed44616c92ec3b36108b01cabfd62489ff0 100644 (file)
@@ -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;
 
This page took 0.022293 seconds and 4 git commands to generate.