diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-09-26 06:05:11 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-09-26 06:05:11 -0700 |
commit | f7f2a36925bb560363f691fc3ca3dec83830dd15 (patch) | |
tree | c09327d910abe4e7947c53dcbb5f15b01ab194c1 /src/util.cpp | |
parent | f8937b2d3bb545a0a6ff78031ce3cdcb3208ecbe (diff) | |
parent | 0465c41c847ddee7eeb5caefb164149400ff8395 (diff) |
Merge pull request #521 from laanwj/qt
Qt GUI
Diffstat (limited to 'src/util.cpp')
-rw-r--r-- | src/util.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/util.cpp b/src/util.cpp index 76a2700271..03b3d73e62 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -264,8 +264,7 @@ int my_snprintf(char* buffer, size_t limit, const char* format, ...) return ret; } - -string strprintf(const char* format, ...) +string strprintf(const std::string &format, ...) { char buffer[50000]; char* p = buffer; @@ -275,7 +274,7 @@ string strprintf(const char* format, ...) { va_list arg_ptr; va_start(arg_ptr, format); - ret = _vsnprintf(p, limit, format, arg_ptr); + ret = _vsnprintf(p, limit, format.c_str(), arg_ptr); va_end(arg_ptr); if (ret >= 0 && ret < limit) break; @@ -292,14 +291,13 @@ string strprintf(const char* format, ...) return str; } - -bool error(const char* format, ...) +bool error(const std::string &format, ...) { char buffer[50000]; int limit = sizeof(buffer); va_list arg_ptr; va_start(arg_ptr, format); - int ret = _vsnprintf(buffer, limit, format, arg_ptr); + int ret = _vsnprintf(buffer, limit, format.c_str(), arg_ptr); va_end(arg_ptr); if (ret < 0 || ret >= limit) { |