summaryrefslogtreecommitdiffhomepage
path: root/Stars45
diff options
context:
space:
mode:
authorrhyskidd@gmail.com <rhyskidd@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2012-07-16 15:54:06 +0000
committerrhyskidd@gmail.com <rhyskidd@gmail.com@076cb2c4-205e-83fd-5cf3-1be9aa105544>2012-07-16 15:54:06 +0000
commit7084c7521db8508c09624345700f4c8a83a97c01 (patch)
tree754003d719f19d493d4079eb5e4f4140a99e656b /Stars45
parent6d8a4e7be5ac0ec59e8bd53c8814e8680291a4cb (diff)
downloadstarshatter-7084c7521db8508c09624345700f4c8a83a97c01.zip
starshatter-7084c7521db8508c09624345700f4c8a83a97c01.tar.gz
starshatter-7084c7521db8508c09624345700f4c8a83a97c01.tar.bz2
PVS-Studio fix: V618 It’s dangerous to call the 'sprintf_s' function in such a manner, as the line being passed could contain format specification. The example of the safe code: printf("%s", str);
Diffstat (limited to 'Stars45')
-rw-r--r--Stars45/MsnEditDlg.cpp2
-rw-r--r--Stars45/NavDlg.cpp2
-rw-r--r--Stars45/RadioTraffic.cpp2
3 files changed, 3 insertions, 3 deletions
diff --git a/Stars45/MsnEditDlg.cpp b/Stars45/MsnEditDlg.cpp
index ed8f912..f26a52b 100644
--- a/Stars45/MsnEditDlg.cpp
+++ b/Stars45/MsnEditDlg.cpp
@@ -342,7 +342,7 @@ MsnEditDlg::DrawPackages()
sprintf_s(txt, "%s %s", design->abrv, design->name);
}
else {
- sprintf_s(txt, Game::GetText("MsnDlg.undefined").data());
+ sprintf_s(txt, "%s", Game::GetText("MsnDlg.undefined").data());
}
lst_elem->SetItemText(i, 3, txt);
diff --git a/Stars45/NavDlg.cpp b/Stars45/NavDlg.cpp
index 7ddd3cd..898636a 100644
--- a/Stars45/NavDlg.cpp
+++ b/Stars45/NavDlg.cpp
@@ -765,7 +765,7 @@ NavDlg::UpdateSelection()
sprintf_s(shield, "%03d", sel_ship->ShieldStrength());
sprintf_s(hull, "%03d", sel_ship->HullStrength());
- sprintf_s(range, Game::GetText("NavDlg.not-avail").data());
+ sprintf_s(range, "%s", Game::GetText("NavDlg.not-avail").data());
if (ship) {
FormatNumberExp(range, Point(sel_ship->Location()-ship->Location()).length()/1000);
diff --git a/Stars45/RadioTraffic.cpp b/Stars45/RadioTraffic.cpp
index d87ed2f..ca5ab92 100644
--- a/Stars45/RadioTraffic.cpp
+++ b/Stars45/RadioTraffic.cpp
@@ -309,7 +309,7 @@ RadioTraffic::DisplayMessage(RadioMessage* msg)
}
else if (msg->Action() == RadioMessage::MOVE_PATROL) {
- sprintf_s(msg_buf, TranslateVox("Move patrol.").data());
+ sprintf_s(msg_buf, "%s.", TranslateVox("Move patrol.").data());
}
else if (target && dst_ship && msg->Sender()) {