diff options
author | Benny Baumann <BenBE@geshi.org> | 2020-09-15 22:02:57 +0200 |
---|---|---|
committer | cgzones <cgzones@googlemail.com> | 2020-09-17 21:43:05 +0200 |
commit | 6921000481d3f8e3e0fecf89df436312efaa691a (patch) | |
tree | b08956732fff6899a8a274f9ea90df3f64b59d7d /OpenFilesScreen.c | |
parent | 6646030116c325157097cf8f66ec83b118d3c54f (diff) |
Barely ever seen any 1000 digit PIDs …
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r-- | OpenFilesScreen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index 3e45bf85..ae32590f 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -52,8 +52,6 @@ void OpenFilesScreen_draw(InfoScreen* this) { } static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { - char buffer[1025]; - xSnprintf(buffer, 1024, "%d", pid); OpenFiles_ProcessData* pdata = xCalloc(1, sizeof(OpenFiles_ProcessData)); OpenFiles_FileData* fdata = NULL; OpenFiles_Data* item = &(pdata->data); @@ -76,6 +74,8 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { exit(1); dup2(fdnull, STDERR_FILENO); close(fdnull); + char buffer[32] = {0}; + xSnprintf(buffer, sizeof(buffer), "%d", pid); execlp("lsof", "lsof", "-P", "-p", buffer, "-F", NULL); exit(127); } |