Skip to content

Commit 88babaa

Browse files
committed
added win32 checks for vsnprintf which is _vsnprintf on windows
svn path=/trunk/matplotlib/; revision=3696
1 parent b1c141e commit 88babaa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

ttconv/ttutil.cpp

+8
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,18 @@ void TTStreamWriter::printf(const char* format, ...)
3232
va_start(arg_list, format);
3333
char buffer[PRINTF_BUFFER_SIZE];
3434

35+
#ifdef WIN32
36+
int size = _vsnprintf(buffer, PRINTF_BUFFER_SIZE, format, arg_list);
37+
#else
3538
int size = vsnprintf(buffer, PRINTF_BUFFER_SIZE, format, arg_list);
39+
#endif
3640
if (size >= PRINTF_BUFFER_SIZE) {
3741
char* buffer2 = (char*)malloc(size);
42+
#ifdef WIN32
43+
_vsnprintf(buffer2, size, format, arg_list);
44+
#else
3845
vsnprintf(buffer2, size, format, arg_list);
46+
#endif
3947
free(buffer2);
4048
} else {
4149
this->write(buffer);

0 commit comments

Comments
 (0)