From 1ab177757bec9eb28482785f75fd8a4fb8a1313c Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Thu, 17 Dec 2009 12:48:02 +0100 Subject: Replace static snprintf() with make_sprintf() where the result is immediately cast to std::string. --- crawl-ref/source/wiz-fsim.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'crawl-ref/source/wiz-fsim.cc') diff --git a/crawl-ref/source/wiz-fsim.cc b/crawl-ref/source/wiz-fsim.cc index 05ea5703dc..8a9929cdc8 100644 --- a/crawl-ref/source/wiz-fsim.cc +++ b/crawl-ref/source/wiz-fsim.cc @@ -300,15 +300,13 @@ static std::string _fsim_time_string() struct tm *ltime = TIME_FN(&curr_time); if (ltime) { - char buf[100]; - snprintf(buf, sizeof buf, "%4d%02d%02d/%2d:%02d:%02d", + return make_stringf("%4d%02d%02d/%2d:%02d:%02d", ltime->tm_year + 1900, ltime->tm_mon + 1, ltime->tm_mday, ltime->tm_hour, ltime->tm_min, ltime->tm_sec); - return (buf); } return (""); } -- cgit v1.2.3-54-g00ecf