Warning, /graphics/okular/core/synctex/patches/06-mingw-_synctex_error.diff is written in an unsupported language. File is not indexed.
0001 _vscprintf() is specific for MSVC; thus in _synctex_error(), for any other 0002 compiler on Windows, use _vsnprintf() and grow the buffer until necessary. 0003 0004 Patch provided by Patrick Spendrin <ps_ml@gmx.de>. 0005 0006 Index: synctex/synctex_parser_utils.c 0007 =================================================================== 0008 --- synctex.orig/synctex_parser_utils.c 0009 +++ synctex/synctex_parser_utils.c 0010 @@ -104,8 +104,26 @@ int _synctex_log(int level, const char * 0011 char *buff; 0012 size_t len; 0013 OutputDebugStringA(prompt); 0014 +# ifdef _MSC_VER 0015 len = _vscprintf(reason, arg) + 1; 0016 buff = (char*)malloc( len * sizeof(char) ); 0017 +# else /* MinGW */ 0018 + size_t buffersize = 1024; 0019 + size_t max_buffersize = 1024 * buffersize; 0020 + int result; 0021 + buff = (char*)malloc(buffersize * sizeof(char)); 0022 + result = _vsnprintf(buff, buffersize - 1, reason, arg); 0023 + while(-1 == result && buffersize <= max_buffersize) { 0024 + buffersize = buffersize * 2; 0025 + buff = (char*)realloc(buff, buffersize * sizeof(char)); 0026 + result = _vsnprintf(buff, buffersize - 1, reason, arg); 0027 + } 0028 + if(-1 == result) { 0029 + // could not make the buffer big enough or simply could not write to it 0030 + free(buff); 0031 + return -1; 0032 + } 0033 +# endif 0034 result = vsprintf(buff, reason, arg) +strlen(prompt); 0035 OutputDebugStringA(buff); 0036 OutputDebugStringA("\n");