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/format.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/format.cc')
-rw-r--r-- | crawl-ref/source/format.cc | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/crawl-ref/source/format.cc b/crawl-ref/source/format.cc index a65613adff..59fc8152bf 100644 --- a/crawl-ref/source/format.cc +++ b/crawl-ref/source/format.cc @@ -514,13 +514,10 @@ void formatted_string::clear() void formatted_string::cprintf(const char *s, ...) { - char buf[1000]; va_list args; va_start(args, s); - vsnprintf(buf, sizeof buf, s, args); + cprintf(make_stringf(s, args)); va_end(args); - - cprintf(std::string(buf)); } void formatted_string::cprintf(const std::string &s) |