diff options
author | Graham Inggs <ginggs@debian.org> | 2018-02-05 14:48:51 +0200 |
---|---|---|
committer | Graham Inggs <ginggs@debian.org> | 2018-02-05 14:48:51 +0200 |
commit | 2ee50d030178cede83eb9d0005fbc19f819d30fe (patch) | |
tree | 67d75c0a7c47e15bed9d0735ecf12abec4f8157b /OpenFilesScreen.c | |
parent | 31b71b67011fa52f091df6fe536a11d6d0bfb256 (diff) | |
download | debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.gz debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.tar.bz2 debian_htop-2ee50d030178cede83eb9d0005fbc19f819d30fe.zip |
Imported Upstream version 2.1.0upstream/2.1.0
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r-- | OpenFilesScreen.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c index 80079d0..a772bba 100644 --- a/OpenFilesScreen.c +++ b/OpenFilesScreen.c @@ -77,7 +77,7 @@ void OpenFilesScreen_draw(InfoScreen* this) { static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { char command[1025]; - snprintf(command, 1024, "lsof -P -p %d -F 2> /dev/null", pid); + xSnprintf(command, 1024, "lsof -P -p %d -F 2> /dev/null", pid); FILE* fd = popen(command, "r"); OpenFiles_ProcessData* pdata = xCalloc(1, sizeof(OpenFiles_ProcessData)); OpenFiles_FileData* fdata = NULL; @@ -102,7 +102,6 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) { fdata = nextFile; item = &(fdata->data); } - assert(cmd >= 0 && cmd <= 0xff); item->data[cmd] = xStrdup(line + 1); free(line); } @@ -132,7 +131,7 @@ void OpenFilesScreen_scan(InfoScreen* this) { int lenN = data['n'] ? strlen(data['n']) : 0; int sizeEntry = 5 + 7 + 10 + 10 + 10 + lenN + 5 /*spaces*/ + 1 /*null*/; char* entry = xMalloc(sizeEntry); - snprintf(entry, sizeEntry, "%5.5s %7.7s %10.10s %10.10s %10.10s %s", + xSnprintf(entry, sizeEntry, "%5.5s %7.7s %10.10s %10.10s %10.10s %s", data['f'] ? data['f'] : "", data['t'] ? data['t'] : "", data['D'] ? data['D'] : "", |