From 03b1d6b74d13dd51a53d2531becb4137b96fa1ed Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Sun, 27 May 2012 09:39:31 +0000 Subject: A few things MSVC's analyzer found. --- Stars45/CampaignSaveGame.cpp | 2 ++ Stars45/FltDlg.cpp | 2 +- Stars45/NetLobbyServer.cpp | 2 +- Stars45/StarServer.cpp | 2 ++ Stars45/Weapon.cpp | 2 +- 5 files changed, 7 insertions(+), 3 deletions(-) (limited to 'Stars45') diff --git a/Stars45/CampaignSaveGame.cpp b/Stars45/CampaignSaveGame.cpp index 8320259..c3cefd4 100644 --- a/Stars45/CampaignSaveGame.cpp +++ b/Stars45/CampaignSaveGame.cpp @@ -125,11 +125,13 @@ static char* ParseMultiLine(const char* s) s++; if (*s == 'n') { *p++ = '\n'; +#pragma warning(suppress: 6269) *s++; i--; } else if (*s == '"') { *p++ = '"'; +#pragma warning(suppress: 6269) *s++; i--; } diff --git a/Stars45/FltDlg.cpp b/Stars45/FltDlg.cpp index 920c58e..04ac926 100644 --- a/Stars45/FltDlg.cpp +++ b/Stars45/FltDlg.cpp @@ -228,7 +228,7 @@ FltDlg::UpdateSelection() hangar_list->SetItemText(item, 4, txt); } - else if (hangar->GetState(s) || Hangar::MAINT || + else if (hangar->GetState(s) == Hangar::MAINT || hangar->GetState(s) > Hangar::STORAGE) { FormatTime(txt, hangar->TimeRemaining(s)); hangar_list->SetItemText(item, 4, txt); diff --git a/Stars45/NetLobbyServer.cpp b/Stars45/NetLobbyServer.cpp index 1c3ce30..13ba07b 100644 --- a/Stars45/NetLobbyServer.cpp +++ b/Stars45/NetLobbyServer.cpp @@ -202,7 +202,7 @@ NetLobbyServer::SendMOTD(NetUser* user) Text* line = motd[i]; sprintf_s(buffer, "id %d user \" \" msg \"%s\"", - motd_index++, *line); + motd_index++, line->data()); SendData(user, NET_LOBBY_CHAT, buffer); } diff --git a/Stars45/StarServer.cpp b/Stars45/StarServer.cpp index 96b34a0..daba657 100644 --- a/Stars45/StarServer.cpp +++ b/Stars45/StarServer.cpp @@ -525,6 +525,8 @@ DWORD WINAPI StarServerRestartProc(LPVOID link) CreateProcess("stars.exe", cmdline, 0, 0, 0, 0, 0, 0, &s, &pi); stars->Exit(); + CloseHandle( pi.hProcess ); + CloseHandle( pi.hThread ); return 0; } diff --git a/Stars45/Weapon.cpp b/Stars45/Weapon.cpp index 26e6a8d..4aa402e 100644 --- a/Stars45/Weapon.cpp +++ b/Stars45/Weapon.cpp @@ -410,7 +410,7 @@ const char* Weapon::GetObserverName() const { static char name[256]; - sprintf_s(name, "Weapon %s", design->name); + sprintf_s(name, "Weapon %s", design->name.data()); return name; } -- cgit v1.1