summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSung-hun Kim <sfoon.kim@samsung.com>2023-02-08 11:01:39 +0900
committerSung-hun Kim <sfoon.kim@samsung.com>2023-02-08 11:01:39 +0900
commitde66f0da2a333df764a55ca30d51a1ab81e73d7d (patch)
treefad4febe6955cbb8ee92df4a3643d1a00dee8542
parent33d5fe691e99d4ce2025980cb620552d92bde577 (diff)
downloadmemps-de66f0da2a333df764a55ca30d51a1ab81e73d7d.tar.gz
memps-de66f0da2a333df764a55ca30d51a1ab81e73d7d.tar.bz2
memps-de66f0da2a333df764a55ca30d51a1ab81e73d7d.zip
Change-Id: I01f06be469807de10ac4f517008d3c36b77e4803 Signed-off-by: Sung-hun Kim <sfoon.kim@samsung.com>
-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);
}