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>

xen-unstable changeset: 26147:3186c04af582
Backport-requested-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
This commit is contained in:
Dan Magenheimer committed 2012-11-14 12:06:00 +00:00
1 parent 45cc0581c6
commit 86d10f2be0
1 file changed
+2
+2
View File
@@ -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) "
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.