summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--memps.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/memps.c b/memps.c
index 26be129..b2a3e3d 100644
--- a/memps.c
+++ b/memps.c
@@ -825,6 +825,7 @@ mapinfo *load_maps_rollup(int pid)
* for getting values quickly
*/
snprintf(tmp, sizeof(tmp), "/proc/%d/smaps_rollup", pid);
+ tmp[sizeof(tmp) - 1] = '\0';
if (access(tmp, F_OK) < 0)
return 0;
return __load_maps(tmp);
@@ -835,6 +836,7 @@ mapinfo *load_maps(int pid)
char tmp[128];
snprintf(tmp, sizeof(tmp), "/proc/%d/smaps", pid);
+ tmp[sizeof(tmp) - 1] = '\0';
return __load_maps(tmp);
}