aboutsummaryrefslogtreecommitdiffstats
path: root/OpenFilesScreen.c
diff options
context:
space:
mode:
authorGraham Inggs <ginggs@debian.org>2018-02-05 14:48:53 +0200
committerGraham Inggs <ginggs@debian.org>2018-02-05 14:48:53 +0200
commit0bffedf65c053726a3a09be93c5eabfc113550fc (patch)
tree8c14970f1890c710df6f72aaa85781d62cee11e5 /OpenFilesScreen.c
parentba3d665468e9752a81a50bb2df7639950e0a3c77 (diff)
parent2ee50d030178cede83eb9d0005fbc19f819d30fe (diff)
downloaddebian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.tar.gz
debian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.tar.bz2
debian_htop-0bffedf65c053726a3a09be93c5eabfc113550fc.zip
Merge tag 'upstream/2.1.0'
Upstream version 2.1.0
Diffstat (limited to 'OpenFilesScreen.c')
-rw-r--r--OpenFilesScreen.c5
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'] : "",

© 2014-2024 Faster IT GmbH | imprint | privacy policy