void Cutscene::appendText(const char *line)
{
- snprintf(text, sizeof text, "%s %s", text, line);
+ strncat(text, " ", sizeof text);
+ strncat(text, line, sizeof text);
}
void Graphics::createChatString(const char *in)
{
- snprintf(chatString, sizeof chatString, "%s %s", chatString, in);
+ strncat(chatString, " ", sizeof chatString);
+ strncat(chatString, in, sizeof chatString);
}
void Graphics::drawChatString(SDL_Surface *surface, int y)
if (game.canContinue > 1)
{
Widget *widget = engine.getWidgetByName("gameOverNo");
- snprintf(widget->label, sizeof widget->label, "%s (%d)", widget->label, game.canContinue);
+ char postfix[100];
+ snprintf(postfix, sizeof postfix, " (%d)", game.canContinue);
+ strncat(widget->label, postfix, sizeof widget->label);
}
while (true)
graphics.drawString(string, x2, y, false, image);
}
- snprintf(string, sizeof string, "%s", _("Total Game Time"));
- snprintf(string, sizeof string, "%s - %.2d:%.2d:%.2d", string, game.totalHours, game.totalMinutes, game.totalSeconds);
+ snprintf(string, sizeof string, "%s - %.2d:%.2d:%.2d", _("Total Game Time"), game.totalHours, game.totalMinutes, game.totalSeconds);
graphics.drawString(string, 200, y += 110, true, image);
break;
if (validStage)
{
graphics.drawRect(10, 400, 620, 20, graphics.black, graphics.white, graphics.screen);
- snprintf(string, sizeof string, "%s", _("Selected Destination"));
- snprintf(string, sizeof string, "%s : %s", string, _(game.stageName));
+ snprintf(string, sizeof string, "%s : %s", _("Selected Destination"), _(game.stageName));
graphics.drawString(string, 320, 409, true, graphics.screen);
}