mirror of
https://github.com/Llewellynvdm/conky.git
synced 2024-11-18 02:55:12 +00:00
Fix bug in $pid_openfiles
This commit is contained in:
parent
bde5845077
commit
e9d92ae717
@ -282,6 +282,7 @@ void print_pid_openfiles(struct text_object *obj, char *p, int p_max_size) {
|
|||||||
struct ll_string* files_back = NULL;
|
struct ll_string* files_back = NULL;
|
||||||
|
|
||||||
dir = opendir(obj->data.s);
|
dir = opendir(obj->data.s);
|
||||||
|
if(dir != NULL) {
|
||||||
while ((entry = readdir(dir))) {
|
while ((entry = readdir(dir))) {
|
||||||
if(entry->d_name[0] != '.') {
|
if(entry->d_name[0] != '.') {
|
||||||
snprintf(buf, p_max_size, "%s/%s", obj->data.s, entry->d_name);
|
snprintf(buf, p_max_size, "%s/%s", obj->data.s, entry->d_name);
|
||||||
@ -300,4 +301,7 @@ void print_pid_openfiles(struct text_object *obj, char *p, int p_max_size) {
|
|||||||
closedir(dir);
|
closedir(dir);
|
||||||
freelist(files_front);
|
freelist(files_front);
|
||||||
p[totallength - strlen("; ")] = 0;
|
p[totallength - strlen("; ")] = 0;
|
||||||
|
} else {
|
||||||
|
p[0] = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user