summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/mon-act.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-12-17 12:48:02 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-12-17 12:48:02 +0100
commit1ab177757bec9eb28482785f75fd8a4fb8a1313c (patch)
tree4b1c8babcca442dc8b91a624b842bc5f30013747 /crawl-ref/source/mon-act.cc
parentc266f14414471d5252130c70bafa0c60f85a265c (diff)
downloadcrawl-ref-1ab177757bec9eb28482785f75fd8a4fb8a1313c.tar.gz
crawl-ref-1ab177757bec9eb28482785f75fd8a4fb8a1313c.zip
Replace static snprintf() with make_sprintf() where the result is immediately cast
to std::string.
Diffstat (limited to 'crawl-ref/source/mon-act.cc')
-rw-r--r--crawl-ref/source/mon-act.cc7
1 files changed, 2 insertions, 5 deletions
diff --git a/crawl-ref/source/mon-act.cc b/crawl-ref/source/mon-act.cc
index 4e866cec38..16c025e217 100644
--- a/crawl-ref/source/mon-act.cc
+++ b/crawl-ref/source/mon-act.cc
@@ -1324,22 +1324,19 @@ static bool _mons_throw(struct monsters *monster, struct bolt &pbolt,
// [dshaligram] When changing bolt names here, you must edit
// hiscores.cc (scorefile_entry::terse_missile_cause()) to match.
- char throw_buff[ITEMNAME_SIZE];
if (projected == LRET_LAUNCHED)
{
- snprintf(throw_buff, sizeof(throw_buff), "Shot with a%s %s by %s",
+ pbolt.aux_source = make_stringf("Shot with a%s %s by %s",
(is_vowel(pbolt.name[0]) ? "n" : ""), pbolt.name.c_str(),
monster->name(DESC_NOCAP_A).c_str());
}
else
{
- snprintf(throw_buff, sizeof(throw_buff), "Hit by a%s %s thrown by %s",
+ pbolt.aux_source = make_stringf("Hit by a%s %s thrown by %s",
(is_vowel(pbolt.name[0]) ? "n" : ""), pbolt.name.c_str(),
monster->name(DESC_NOCAP_A).c_str());
}
- pbolt.aux_source = throw_buff;
-
// Add everything up.
pbolt.hit = baseHit + random2avg(exHitBonus, 2) + ammoHitBonus;
pbolt.damage =