From: Robert Luberda Date: Sat, 25 Oct 2014 16:59:17 +0200 Subject: 43 Fix gcc warning Fix "undefined behaviour" warning --- libAfterConf/Database.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libAfterConf/Database.c b/libAfterConf/Database.c index c10df0d..1cfc7f9 100644 --- libAfterConf/Database.c +++ libAfterConf/Database.c @@ -578,7 +578,8 @@ void delete_name_list (name_list ** head) style_delete (*head, head); } -static unsigned long window_style_cross[][2] = +#define WINDOW_STYLE_CROSS_STYLES 4 +static unsigned long window_style_cross[WINDOW_STYLE_CROSS_STYLES][2] = { {DATABASE_FocusStyle_ID, BACK_FOCUSED}, {DATABASE_UnfocusStyle_ID, BACK_UNFOCUSED}, {DATABASE_StickyStyle_ID, BACK_STICKY}, @@ -631,7 +632,7 @@ void ParseSingleStyle (FreeStorageElem * storage, name_list * style) case DATABASE_FocusStyle_ID: case DATABASE_UnfocusStyle_ID: case DATABASE_StickyStyle_ID: - for (i = 0; i < BACK_STYLES; i++) + for (i = 0; i < WINDOW_STYLE_CROSS_STYLES; i++) if (window_style_cross[i][0] == storage->term->id) { char **s = &(style->window_styles[window_style_cross[i][1]]);