diff options
author | rubidium <rubidium@openttd.org> | 2008-05-05 18:27:57 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2008-05-05 18:27:57 +0000 |
commit | 41aeb7ffa0c0eee3b355d5c2dee03efc773462dd (patch) | |
tree | 215c6573bc8d0bbf377931616ac13efcf43bd26b /src | |
parent | 8580edbf20559d95c4d0c3b68c909bf797942c1a (diff) | |
download | openttd-41aeb7ffa0c0eee3b355d5c2dee03efc773462dd.tar.xz |
(svn r12957) -Codechange: do not misuse snprintf when you just want to copy a string, also use DEBUG instead of fprintf in one case.
Diffstat (limited to 'src')
-rw-r--r-- | src/network/network_client.cpp | 4 | ||||
-rw-r--r-- | src/saveload.cpp | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index eb129ffe1..3516baa9f 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -82,10 +82,10 @@ void HashCurrentCompanyPassword() 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)); } diff --git a/src/saveload.cpp b/src/saveload.cpp index 33b5c7eaf..8a4eba1a7 100644 --- a/src/saveload.cpp +++ b/src/saveload.cpp @@ -1580,7 +1580,7 @@ static SaveOrLoadResult SaveFileToDisk(bool threaded) if (_sl.excpt_uninit != NULL) _sl.excpt_uninit(); ShowInfo(GetSaveLoadErrorString()); - fprintf(stderr, GetSaveLoadErrorString()); + DEBUG(sl, 0, GetSaveLoadErrorString()); if (threaded) { SetAsyncSaveFinish(SaveFileError); |