Skip to content
Permalink
Browse files

Use format strings with ssprintf. Patch by c-korn.

May fix compilation on some Ubuntu systems.
  • Loading branch information...
Cyp committed May 18, 2017
1 parent 3ec60e3 commit 34f32b0adf2a975747f107117fb4af715a63fa73
Showing with 12 additions and 12 deletions.
  1. +1 −1 lib/netplay/netplay.cpp
  2. +8 −8 src/multiint.cpp
  3. +1 −1 src/multijoin.cpp
  4. +2 −2 src/multiplay.cpp
@@ -1016,7 +1016,7 @@ static bool upnp_add_redirect(int port)
debug(LOG_NET, "%s", buf);
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
// beware of writing a line too long, it screws up console line count. \n is safe for line split
ssprintf(buf, _("You must manually configure your router & firewall to\n open port 2100 before you can host a game."));
ssprintf(buf, "%s", _("You must manually configure your router & firewall to\n open port 2100 before you can host a game."));
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
return false;
}
@@ -3014,7 +3014,7 @@ static void processMultiopWidgets(UDWORD id)
else
{
NETresetGamePassword();
ssprintf(buf, _("*** password is NOT required! ***"));
ssprintf(buf, "%s", _("*** password is NOT required! ***"));
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
}
NETGameLocked(willSet);
@@ -3028,7 +3028,7 @@ static void processMultiopWidgets(UDWORD id)
{
case MULTIOP_MAP_MOD:
char buf[256];
ssprintf(buf, _("This is a map-mod, it can change your playing experience!"));
ssprintf(buf, "%s", _("This is a map-mod, it can change your playing experience!"));
addConsoleMessage(buf, DEFAULT_JUSTIFY, SYSTEM_MESSAGE);
break;

@@ -3862,34 +3862,34 @@ bool startMultiOptions(bool bReenter)
{
if (NetPlay.isUPNP_CONFIGURED)
{
ssprintf(buf, _("UPnP has been enabled."));
ssprintf(buf, "%s", _("UPnP has been enabled."));
}
else
{
if (NetPlay.isUPNP_ERROR)
{
ssprintf(buf, _("UPnP detection faled. You must manually configure router yourself."));
ssprintf(buf, "%s", _("UPnP detection faled. You must manually configure router yourself."));
}
else
{
ssprintf(buf, _("UPnP detection is in progress..."));
ssprintf(buf, "%s", _("UPnP detection is in progress..."));
}
}
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
}
else
{
ssprintf(buf, _("UPnP detection disabled by user. Autoconfig of port 2100 will not happen."));
ssprintf(buf, "%s", _("UPnP detection disabled by user. Autoconfig of port 2100 will not happen."));
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
}
}
if (challengeActive)
{
ssprintf(buf, _("Hit the ready box to begin your challenge!"));
ssprintf(buf, "%s", _("Hit the ready box to begin your challenge!"));
}
else if (!bHosted)
{
ssprintf(buf, _("Press the start hosting button to begin hosting a game."));
ssprintf(buf, "%s", _("Press the start hosting button to begin hosting a game."));
}
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
}
@@ -484,7 +484,7 @@ void ShowMOTD()
if (NetPlay.HaveUpgrade)
{
audio_PlayTrack(ID_SOUND_BUILD_FAIL);
ssprintf(buf, _("There is an update to the game, please visit http://wz2100.net to download new version."));
ssprintf(buf, "%s", _("There is an update to the game, please visit http://wz2100.net to download new version."));
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
}
else
@@ -1703,11 +1703,11 @@ bool recvMapFileData(NETQUEUE queue)
char buf[256];
if (game.isMapMod)
{
ssprintf(buf, _("Warning, this is a map-mod, it could alter normal gameplay."));
ssprintf(buf, "%s", _("Warning, this is a map-mod, it could alter normal gameplay."));
}
else
{
ssprintf(buf, _("Warning, HOST has altered the game code, and can't be trusted!"));
ssprintf(buf, "%s", _("Warning, HOST has altered the game code, and can't be trusted!"));
}
addConsoleMessage(buf, DEFAULT_JUSTIFY, NOTIFY_MESSAGE);
game.isMapMod = true;

0 comments on commit 34f32b0

Please sign in to comment.
You can’t perform that action at this time.