mirror of https://github.com/xzeldon/htop.git
Correction to smaps buffer size passed to smaps path snprintf
This commit is contained in:
parent
f9625cacf0
commit
eef6bc447d
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue