1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-16 01:57:09 +00:00

Confirm that index is greater than 0

This commit is contained in:
Mithil Poojary 2020-10-03 03:56:28 +05:30 committed by Brenden Matthews
parent b97eff4dbe
commit ddb70b4ba9

View File

@ -525,7 +525,9 @@ void print_pid_thread_list(struct text_object *obj, char *p,
}
}
closedir(dir);
if (p[totallength - 1] == ',') { p[totallength - 1] = 0; }
if (totallength > 0 && p[totallength - 1] == ',') {
p[totallength - 1] = 0;
}
} else {
p[0] = 0;
}