vici: Use %u to print stats returned by mallinfo(3)
authorTobias Brunner <tobias@strongswan.org>
Fri, 13 Mar 2015 14:20:39 +0000 (15:20 +0100)
committerTobias Brunner <tobias@strongswan.org>
Fri, 13 Mar 2015 14:26:01 +0000 (15:26 +0100)
Fixes #886.

src/libcharon/plugins/vici/vici_query.c

index 5a8ef25..7e4e241 100644 (file)
@@ -977,10 +977,10 @@ CALLBACK(stats, vici_message_t*,
                struct mallinfo mi = mallinfo();
 
                b->begin_section(b, "mallinfo");
-               b->add_kv(b, "sbrk", "%d", mi.arena);
-               b->add_kv(b, "mmap", "%d", mi.hblkhd);
-               b->add_kv(b, "used", "%d", mi.uordblks);
-               b->add_kv(b, "free", "%d", mi.fordblks);
+               b->add_kv(b, "sbrk", "%u", mi.arena);
+               b->add_kv(b, "mmap", "%u", mi.hblkhd);
+               b->add_kv(b, "used", "%u", mi.uordblks);
+               b->add_kv(b, "free", "%u", mi.fordblks);
                b->end_section(b);
        }
 #endif /* HAVE_MALLINFO */