*fix* once again issue 192

git-svn-id: http://tint2.googlecode.com/svn/trunk@320 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
This commit is contained in:
Andreas.Fink85 2010-01-05 11:24:48 +00:00
parent da8a260659
commit 755d6672fe

View file

@ -287,7 +287,7 @@ void add_entry (char *key, char *value)
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));
@ -361,7 +361,7 @@ void add_entry (char *key, char *value)
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));
@ -407,7 +407,7 @@ void add_entry (char *key, char *value)
}
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));
@ -442,14 +442,14 @@ void add_entry (char *key, char *value)
}
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));
@ -510,14 +510,14 @@ void add_entry (char *key, char *value)
}
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));
@ -539,7 +539,7 @@ void add_entry (char *key, char *value)
}
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));
@ -582,7 +582,7 @@ void add_entry (char *key, char *value)
}
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));