summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libutil.cc
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2009-12-16 23:32:34 -0600
committerJesse Luehrs <doy@tozt.net>2009-12-16 23:32:58 -0600
commitb87aa0f9d3d43fe02ee440803adbc4e967985162 (patch)
tree5de87d392bca66cfa929d4d051acf5d30969dd7e /crawl-ref/source/libutil.cc
parent761b088e911386a2860ba50a8a3271739264283c (diff)
downloadcrawl-ref-b87aa0f9d3d43fe02ee440803adbc4e967985162.tar.gz
crawl-ref-b87aa0f9d3d43fe02ee440803adbc4e967985162.zip
remove line length limit for .des files
Diffstat (limited to 'crawl-ref/source/libutil.cc')
-rw-r--r--crawl-ref/source/libutil.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/crawl-ref/source/libutil.cc b/crawl-ref/source/libutil.cc
index eeaf949b61..4ea5b0dace 100644
--- a/crawl-ref/source/libutil.cc
+++ b/crawl-ref/source/libutil.cc
@@ -141,12 +141,14 @@ std::string make_stringf(const char *s, ...)
va_list args;
va_start(args, s);
- char buf[400];
- vsnprintf(buf, sizeof buf, s, args);
+ size_t len = vsnprintf(NULL, 0, s, args);
+ char *buf = (char *)malloc(len + 1);
+ vsnprintf(buf, len + 1, s, args);
+ std::string ret(buf);
+ free(buf);
va_end(args);
-
- return (buf);
+ return (ret);
}
std::string &escape_path_spaces(std::string &s)