panel_config.g_task.font_shadow = atoi (value);
else if (strcmp (key, "panel_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.area.pix.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config.area.pix.border, &a->pix.border, sizeof(Border));
else if (strcmp (key, "battery_background_id") == 0) {
#ifdef ENABLE_BATTERY
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.battery.area.pix.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config.battery.area.pix.border, &a->pix.border, sizeof(Border));
}
else if (strcmp (key, "clock_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.clock.area.pix.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config.clock.area.pix.border, &a->pix.border, sizeof(Border));
}
else if (strcmp (key, "taskbar_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.g_taskbar.pix.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config.g_taskbar.pix.border, &a->pix.border, sizeof(Border));
}
else if (strcmp (key, "taskbar_active_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.g_taskbar.pix_active.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config.g_taskbar.pix_active.border, &a->pix.border, sizeof(Border));
}
else if (strcmp (key, "task_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.g_task.area.pix.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config.g_task.area.pix.border, &a->pix.border, sizeof(Border));
}
else if (strcmp (key, "task_active_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&panel_config.g_task.area.pix_active.back, &a->pix.back, sizeof(Color));
memcpy(&panel_config.g_task.area.pix_active.border, &a->pix.border, sizeof(Border));
}
else if (strcmp (key, "systray_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&systray.area.pix.back, &a->pix.back, sizeof(Color));
memcpy(&systray.area.pix.border, &a->pix.border, sizeof(Border));
}
else if (strcmp (key, "tooltip_background_id") == 0) {
int id = atoi (value);
- id = id < back_count ? id : 0;
+ id = (id < back_count && id >= 0) ? id : 0;
Area *a = g_slist_nth_data(list_back, id);
memcpy(&g_tooltip.background_color, &a->pix.back, sizeof(Color));
memcpy(&g_tooltip.border, &a->pix.border, sizeof(Border));