*fix* once again issue 192 git-svn-id: http://tint2.googlecode.com/svn/trunk@320 121b4492-b84c-0410-8b4c-0d4edfb3f3cc
Andreas.Fink85 Andreas.Fink85@121b4492-b84c-0410-8b4c-0d4edfb3f3cc
1 files changed,
9 insertions(+),
9 deletions(-)
jump to
M
src/config.c
→
src/config.c
@@ -287,7 +287,7 @@ else if (strcmp (key, "font_shadow") == 0)
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 @@ }
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 @@ if (value3) panel_config.clock.area.paddingx = atoi (value3);
} 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 @@ if (value3) panel_config.g_taskbar.paddingx = atoi (value3);
} 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 @@ panel_config.g_task.brightness_active = atoi(value3);
} 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 @@ if (value3) systray.area.paddingx = atoi (value3);
} 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 @@ if (value2) g_tooltip.paddingy = atoi(value2);
} 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));