]> git.pond.sub.org Git - empserver/commit
bomb launch interdiction: Fix crash on bombs missing target
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 27 Dec 2020 11:43:19 +0000 (12:43 +0100)
committerMarkus Armbruster <armbru@pond.sub.org>
Sat, 23 Jan 2021 06:08:21 +0000 (07:08 +0100)
commit9d87eb9e22cb654a4759f6b640f21e09cef5e9e9
treea790f0d71e5b687118117e64ebbdd7e57967c25f
parent37c69a3a7a1e556cfa43b54ebc5269445c9c61cc
bomb launch interdiction: Fix crash on bombs missing target

plane damage() prints @noisy with snprintf() even when it's null.  It
doesn't actually use the output then.  Some systems (GNU, Windows)
deal gracefully with printing null strings, others crash.  @noisy is
null when bombers or missiles miss and do collateral damage.  Affects
bomb, launch, and interdiction missions.  Broken in commit 820d755e5
"subs: Change pln_damage()'s parameter noisy to string prefix",
v4.3.33.

Fix by guarding the snprintf().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
src/lib/subs/plnsub.c