aboutsummaryrefslogtreecommitdiffhomepage
path: root/common.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-09 18:43:36 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-09 18:43:36 -0800
commite5ff5f7484c0e751172a2cab65d6d88a68ef281d (patch)
treeab384fbf6216fa62a602fab569a6ffc47d629fa6 /common.cpp
parent646240fc54617d39e0768d256a15eda94ee52812 (diff)
Some hopefully good changes to get IOs off of halloc
Diffstat (limited to 'common.cpp')
-rw-r--r--common.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/common.cpp b/common.cpp
index 0cab244d..40c07404 100644
--- a/common.cpp
+++ b/common.cpp
@@ -113,11 +113,6 @@ int debug_level=1;
*/
static struct winsize termsize;
-/**
- String buffer used by the wsetlocale function
-*/
-static string_buffer_t *setlocale_buff=0;
-
void show_stackframe()
{
@@ -485,20 +480,26 @@ wchar_t **strv2wcsv( const char **in )
return res;
}
-
wcstring format_string(const wchar_t *format, ...)
{
va_list va;
va_start( va, format );
+ wcstring result = vformat_string(format, va);
+ va_end( va );
+ return result;
+}
+
+wcstring vformat_string(const wchar_t *format, va_list va_orig)
+{
string_buffer_t buffer;
sb_init(&buffer);
- sb_vprintf(&buffer, format, va);
+ sb_vprintf(&buffer, format, va_orig);
wcstring result = (wchar_t *)buffer.buff;
sb_destroy(&buffer);
- va_end( va );
return result;
}
+
wchar_t *wcsvarname( const wchar_t *str )
{
while( *str )