diff -Naur icebreaker-1.9.7-orig/menu.c icebreaker-1.9.7/menu.c --- icebreaker-1.9.7-orig/menu.c 2002-06-01 16:46:46 +0000 +++ icebreaker-1.9.7/menu.c 2009-07-20 11:23:04 +0000 @@ -522,7 +522,7 @@ { // "random", at the end/beginning of the list strncpy(val,"random",MAXMENUVALUELENGTH); - snprintf(options.theme,MAXMENUVALUELENGTH,"random"); + snprintf(options.theme,MAXTHEMENAMELENGTH,"random"); settheme("linux"); // just for pretty @@ -538,13 +538,13 @@ if (mbutton==1 || mbutton==4) // left click or scroll forwards { strncpy(val,themelist[(t+1)%themecount],MAXMENUVALUELENGTH); - snprintf(options.theme,MAXMENUVALUELENGTH,themelist[(t+1)%themecount]); + snprintf(options.theme,MAXTHEMENAMELENGTH,themelist[(t+1)%themecount]); } else // right or middle or scroll back { if (t<0) t=themecount; strncpy(val,themelist[(t-1)%themecount],MAXMENUVALUELENGTH); - snprintf(options.theme,MAXMENUVALUELENGTH,themelist[(t-1)%themecount]); + snprintf(options.theme,MAXTHEMENAMELENGTH,themelist[(t-1)%themecount]); } settheme(options.theme); diff -Naur icebreaker-1.9.7-orig/themes.c icebreaker-1.9.7/themes.c --- icebreaker-1.9.7-orig/themes.c 2002-05-31 03:49:53 +0000 +++ icebreaker-1.9.7/themes.c 2009-07-20 11:24:17 +0000 @@ -474,7 +474,7 @@ int setrandomtheme() { - char themename[MAXTHEMENAMELENGTH]; + char themename[MAXTHEMENAMELENGTH+1]; char** themelist; int themecount; @@ -483,11 +483,11 @@ { fprintf(stderr,"Hey! You can't have a theme named random! Please remove the random.ibt\n" "file from your themes directory.\n"); - snprintf(themename,MAXTHEMENAMELENGTH+1,"linux"); + snprintf(themename,MAXTHEMENAMELENGTH,"linux"); } else { - snprintf(themename,MAXTHEMENAMELENGTH+1,themelist[random() %themecount]); + snprintf(themename,MAXTHEMENAMELENGTH,themelist[random() %themecount]); } freethemenames(&themelist,themecount); return settheme(themename);