From: Holger Schemel Date: Fri, 14 Sep 2018 15:49:59 +0000 (+0200) Subject: small change to prevent compiler warning X-Git-Tag: 4.1.1.0~34 X-Git-Url: https://git.artsoft.org/?p=rocksndiamonds.git;a=commitdiff_plain;h=9fe7d0e238a00bba4a9a9a9a11e954942741f3a3;ds=sidebyside small change to prevent compiler warning This change makes Clang happy (which issued a warning before). (Interestingly, GCC did not care about the previous code.) --- diff --git a/src/network.c b/src/network.c index dcd92594..cd004f62 100644 --- a/src/network.c +++ b/src/network.c @@ -747,11 +747,12 @@ static void Handle_OP_STOP_PLAYING() boolean stopped_by_remote_player = (!client_player->connected_locally); char message[100]; - sprintf(message, (cause_for_stopping == NETWORK_STOP_BY_PLAYER ? - "Network game stopped by player %d!" : - cause_for_stopping == NETWORK_STOP_BY_ERROR ? - "Network game stopped due to internal error!" : - "Network game stopped!"), client_nr); + if (cause_for_stopping == NETWORK_STOP_BY_PLAYER) + sprintf(message, "Network game stopped by player %d!", client_nr); + else + sprintf(message, (cause_for_stopping == NETWORK_STOP_BY_ERROR ? + "Network game stopped due to internal error!" : + "Network game stopped!")); if (cause_for_stopping != NETWORK_STOP_BY_PLAYER || stopped_by_remote_player)