Correction to smaps buffer size passed to smaps path snprintf

This commit is contained in:
Nathan Scott 2020-08-19 17:50:43 +10:00
parent f9625cacf0
commit eef6bc447d
1 changed files with 2 additions and 2 deletions

View File

@ -505,9 +505,9 @@ static bool LinuxProcessList_readSmapsFile(LinuxProcess* process, const char* di
ssize_t nread=0;
int tmp=0;
if(haveSmapsRollup) {// only available in Linux 4.14+
snprintf(buffer, MAX_NAME, "%s/%s/smaps_rollup", dirname, name);
snprintf(buffer, PAGE_SIZE-1, "%s/%s/smaps_rollup", dirname, name);
} else {
snprintf(buffer, MAX_NAME, "%s/%s/smaps", dirname, name);
snprintf(buffer, PAGE_SIZE-1, "%s/%s/smaps", dirname, name);
}
int fd = open(buffer, O_RDONLY);
if (fd == -1)