Bump for 4.0-11
[LibreOffice.git] / liblangtag / liblangtag-0.4.0-vsnprintf.patch
blob09e1987677ec987f0d227446b88f589293803897
1 --- misc/liblangtag-0.4.0/liblangtag/lt-utils.c 2012-12-01 10:46:26.000000000 +0100
2 +++ misc/build/liblangtag-0.4.0/liblangtag/lt-utils.c 2012-12-01 13:17:41.421568551 +0100
3 @@ -18,6 +18,7 @@
4 #include <stdio.h>
5 #include <string.h>
6 #include <memory.h>
7 +#include <stdlib.h>
8 #include "lt-messages.h"
9 #include "lt-utils.h"
11 @@ -121,7 +121,7 @@ char *
12 lt_strdup_vprintf(const char *format,
13 va_list args)
15 - char *retval, c;
16 + char *retval, tmpbuf[ 16384 ];
17 va_list ap;
18 int size;
20 @@ -133,7 +133,9 @@ lt_strdup_vprintf(const char *format,
21 va_copy(ap, args);
22 #endif
24 - size = vsnprintf(&c, 1, format, ap) + 1;
25 + size = vsnprintf(tmpbuf, sizeof(tmpbuf), format, ap) + 1;
26 + if( size == 0 ) // -1 + 1
27 + abort();
29 va_end(ap);