Ok the issue at hand is these functions:
sprintf(help1, "Risk of hostilities: %d %%%%%%%%%%%%%%%%", www.ambushRisk[ambushMood][0]);
sprintf(help2, "Risk of hostilities: %d %%%%%%%%%%%%%%%%", www.ambushRisk[ambushMood][1]);
sprintf(help1, "Risk of hostilities: %d %%%%%%%%%%%%%%%%", www.ambushRisk[ambushMood][0]);
sprintf(help2, "Risk of hostilities: %d %%%%%%%%%%%%%%%%", www.ambushRisk[ambushMood][1]);
gui.setPopupChoicesMouseover(gui.popupHolder.pos.x + 40, 610, help1, help2);
void gameGUI::setPopupChoicesMouseover(int x, int y, char * c0, char * c1)
{
if (x){
popupHolder.popupHelpX = x;
popupHolder.popupHelpY = y;
}
if (c0 && c0[0] != 0) { sprintf(popupHolder.answerMouseover[0], c0); }
if (c1 && c1[0] != 0) { sprintf(popupHolder.answerMouseover[1], c1); }
}
1. So first a sprintf to format the input.
2. Then a sprintf when I "store" the input (in setPopupChoicesHelp) in the gui class
3. Then another sprintf when the stored char array is sent to the drawing function to draw the text to screen when hoovering the button in question. And that function can also take "..."-parameters so I need a sprintf there as well 
It seems every step doubles the amount of %-signs I need so I end up with an actual %-sign in the "end function."