--- a/dialog.c +++ b/dialog.c @@ -279,10 +279,10 @@ PopupReturnType popuphighscores() for (i=0;i0) { - snprintf(originaltheme,MAXTHEMENAMELENGTH+1,"%s",commandline.theme); + snprintf(originaltheme,sizeof(originaltheme),"%s",commandline.theme); originalthemecl=true; } else { - snprintf(originaltheme,MAXTHEMENAMELENGTH+1,"%s",options.theme); + snprintf(originaltheme,sizeof(originaltheme),"%s",options.theme); originalthemecl=false; } @@ -521,7 +521,7 @@ PopupReturnType menuitem_theme(char * va if (((mbutton==1 || mbutton==4) && t==themecount-1) || ((mbutton!=1 && mbutton!=4) && t==0)) { // "random", at the end/beginning of the list - strncpy(val,"random",MAXMENUVALUELENGTH); + strcpy(options.theme,"random"); snprintf(options.theme,MAXMENUVALUELENGTH,"random"); settheme("linux"); // just for pretty @@ -538,7 +538,7 @@ PopupReturnType menuitem_theme(char * va 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,sizeof(options.theme),"%s",themelist[(t+1)%themecount]); } else // right or middle or scroll back { --- a/hiscore.c +++ b/hiscore.c @@ -72,7 +72,7 @@ // make sure all entries are zeroed out to start. for (i=0;i