(svn r12957) -Codechange: do not misuse snprintf when you just want to copy a string, also use DEBUG instead of fprintf in one case.
--- a/config.lib Mon May 05 16:05:36 2008 +0000
+++ b/config.lib Mon May 05 18:27:57 2008 +0000
@@ -934,7 +934,7 @@
fi
if [ $cc_version -ge 30 ]; then
- CFLAGS="$CFLAGS -W -Wno-unused-parameter"
+ CFLAGS="$CFLAGS -W -Wno-unused-parameter -Wformat=2"
fi
if [ $cc_version -ge 34 ]; then
--- a/src/network/network_client.cpp Mon May 05 16:05:36 2008 +0000
+++ b/src/network/network_client.cpp Mon May 05 18:27:57 2008 +0000
@@ -82,10 +82,10 @@
if (StrEmpty(_network_player_info[_local_player].password)) return;
_password_game_seed = _patches.generation_seed;
- snprintf(_password_server_unique_id, sizeof(_password_server_unique_id), _network_unique_id);
+ ttd_strlcpy(_password_server_unique_id, _network_unique_id, sizeof(_password_server_unique_id));
const char *new_pw = GenerateCompanyPasswordHash(_network_player_info[_local_player].password);
- snprintf(_network_player_info[_local_player].password, sizeof(_network_player_info[_local_player].password), new_pw);
+ ttd_strlcpy(_network_player_info[_local_player].password, new_pw, sizeof(_network_player_info[_local_player].password));
}
--- a/src/saveload.cpp Mon May 05 16:05:36 2008 +0000
+++ b/src/saveload.cpp Mon May 05 18:27:57 2008 +0000
@@ -1580,7 +1580,7 @@
if (_sl.excpt_uninit != NULL) _sl.excpt_uninit();
ShowInfo(GetSaveLoadErrorString());
- fprintf(stderr, GetSaveLoadErrorString());
+ DEBUG(sl, 0, GetSaveLoadErrorString());
if (threaded) {
SetAsyncSaveFinish(SaveFileError);