aboutsummaryrefslogtreecommitdiffstats
path: root/tools/misc
diff options
context:
space:
mode:
authorDan Magenheimer <dan.magenheimer@oracle.com>2012-11-14 10:24:28 +0000
committerDan Magenheimer <dan.magenheimer@oracle.com>2012-11-14 10:24:28 +0000
commitb46c24edb7b8acba387b8621f867b7d4c5fce1b3 (patch)
tree149ad821a0b8d65f2c246571467c1631ff75eba0 /tools/misc
parente3f4dd42f626e6bf8b684eb3d157f66b60751eb4 (diff)
downloadxen-b46c24edb7b8acba387b8621f867b7d4c5fce1b3.tar.gz
xen-b46c24edb7b8acba387b8621f867b7d4c5fce1b3.tar.bz2
xen-b46c24edb7b8acba387b8621f867b7d4c5fce1b3.zip
xen-tmem-list-parse: fix ugly parse output
The program xen-tmem-list-parse parses the output of xm/xl tmem-list into human-readable format. A missing NULL terminator sometimes causes garbage to be spewed where the two-letter pool type should be output. Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/misc')
-rw-r--r--tools/misc/xen-tmem-list-parse.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/misc/xen-tmem-list-parse.c b/tools/misc/xen-tmem-list-parse.c
index 977e4d3cc2..f32b107dce 100644
--- a/tools/misc/xen-tmem-list-parse.c
+++ b/tools/misc/xen-tmem-list-parse.c
@@ -243,6 +243,7 @@ void parse_pool(char *s)
unsigned long long flush_objs = parse(s,"ot");
parse_string(s,"PT",pool_type,2);
+ pool_type[2] = '\0';
if (pool_type[1] == 'S')
return; /* no need to repeat print data for shared pools */
printf("domid%lu,id%lu[%s]:pgp=%llu(max=%llu) obj=%llu(%llu) "
@@ -286,6 +287,7 @@ void parse_shared_pool(char *s)
unsigned long long flush_objs = parse(s,"ot");
parse_string(s,"PT",pool_type,2);
+ pool_type[2] = '\0';
parse_sharers(s,"SC",buf,BUFSIZE);
printf("poolid=%lu[%s] uuid=%llx.%llx, shared-by:%s: "
"pgp=%llu(max=%llu) obj=%llu(%llu) "