1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-12-25 12:10:03 +00:00
This commit is contained in:
su8 2018-08-06 10:42:08 +02:00
parent e29ebfa29f
commit 25eac4c0e5

View File

@ -535,13 +535,19 @@ static void print_top_time(struct text_object *obj, char *p, int p_max_size) {
static void print_top_user(struct text_object *obj, char *p, int p_max_size) {
auto *td = static_cast<struct top_data *>(obj->data.opaque);
struct passwd *pw;
if ((td == nullptr) || (td->list == nullptr) ||
(td->list[td->num] == nullptr)) {
return;
}
snprintf(p, p_max_size, "%.8s", getpwuid(td->list[td->num]->uid)->pw_name);
pw = getpwuid(td->list[td->num]->uid);
if (pw != nullptr) {
snprintf(p, p_max_size, "%.8s", pw->pw_name);
} else {
NORM_ERR("The uid doesn't exist");
}
}
#define PRINT_TOP_GENERATOR(name, width, fmt, field) \