diff options
author | Adam Borowski <kilobyte@angband.pl> | 2009-12-17 12:48:02 +0100 |
---|---|---|
committer | Adam Borowski <kilobyte@angband.pl> | 2009-12-17 12:48:02 +0100 |
commit | 1ab177757bec9eb28482785f75fd8a4fb8a1313c (patch) | |
tree | 4b1c8babcca442dc8b91a624b842bc5f30013747 /crawl-ref/source/place.cc | |
parent | c266f14414471d5252130c70bafa0c60f85a265c (diff) | |
download | crawl-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/place.cc')
-rw-r--r-- | crawl-ref/source/place.cc | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/crawl-ref/source/place.cc b/crawl-ref/source/place.cc index a07929b723..03fffbd370 100644 --- a/crawl-ref/source/place.cc +++ b/crawl-ref/source/place.cc @@ -114,21 +114,18 @@ std::string place_name( unsigned short place, bool long_name, if (include_number && branches[branch].depth != 1) { - char buf[200]; if (long_name) { // decapitalise 'the' if ( result.find("The") == 0 ) result[0] = 't'; - snprintf( buf, sizeof buf, "Level %d of %s", - lev, result.c_str() ); + result = make_stringf("Level %d of %s", + lev, result.c_str()); } else if (lev) - snprintf( buf, sizeof buf, "%s:%d", result.c_str(), lev ); + result = make_stringf("%s:%d", result.c_str(), lev); else - snprintf( buf, sizeof buf, "%s:$", result.c_str() ); - - result = buf; + result = make_stringf("%s:$", result.c_str()); } return result; } |