From b87aa0f9d3d43fe02ee440803adbc4e967985162 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 16 Dec 2009 23:32:34 -0600 Subject: remove line length limit for .des files --- crawl-ref/source/libutil.cc | 10 ++++++---- 1 file 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) -- cgit v1.2.3-54-g00ecf