procrank: Use %zu for size_t and %d for pid_t
Change-Id: Ic339a05a3091ec6b33b68bc5e76082de3513e9c7
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
diff --git a/procrank/procrank.c b/procrank/procrank.c
index 213dacb..945e940 100644
--- a/procrank/procrank.c
+++ b/procrank/procrank.c
@@ -271,13 +271,13 @@
printf("%5d ", procs[i]->pid);
if (ws) {
- printf("%6dK %6dK %6dK ",
+ printf("%6zuK %6zuK %6zuK ",
procs[i]->usage.rss / 1024,
procs[i]->usage.pss / 1024,
procs[i]->usage.uss / 1024
);
} else {
- printf("%7dK %6dK %6dK %6dK ",
+ printf("%7zuK %6zuK %6zuK %6zuK ",
procs[i]->usage.vss / 1024,
procs[i]->usage.rss / 1024,
procs[i]->usage.pss / 1024,
@@ -286,7 +286,7 @@
}
if (has_swap) {
- printf("%6dK ", procs[i]->usage.swap / 1024);
+ printf("%6zuK ", procs[i]->usage.swap / 1024);
}
printf("%s\n", cmdline);
@@ -375,7 +375,7 @@
return -1;
}
- if (asprintf(&filename, "/proc/%zd/cmdline", pid) < 0) {
+ if (asprintf(&filename, "/proc/%d/cmdline", pid) < 0) {
rc = 1;
goto exit;
}