mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-10-21 14:53:44 +03:00
fixing a portability problem on some old Unices with patch from Albert
* error.c: fixing a portability problem on some old Unices with patch from Albert Chin Daniel
This commit is contained in:
@@ -1,4 +1,10 @@
|
|||||||
|
Fri Oct 28 10:24:39 CEST 2005 Daniel Veillard <daniel@veillard.com>
|
||||||
|
|
||||||
|
* error.c: fixing a portability problem on some old Unices with
|
||||||
|
patch from Albert Chin
|
||||||
|
|
||||||
2005-10-27 Aleksey Sanin <aleksey@aleksey.com>
|
2005-10-27 Aleksey Sanin <aleksey@aleksey.com>
|
||||||
|
|
||||||
* c14n.c result/c14n/exc-without-comments/test-2
|
* c14n.c result/c14n/exc-without-comments/test-2
|
||||||
test/c14n/exc-without-comments/test-2.xml
|
test/c14n/exc-without-comments/test-2.xml
|
||||||
test/c14n/exc-without-comments/test-2.xpath: fixing
|
test/c14n/exc-without-comments/test-2.xpath: fixing
|
||||||
|
11
error.c
11
error.c
@@ -21,7 +21,7 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
|
|||||||
...);
|
...);
|
||||||
|
|
||||||
#define XML_GET_VAR_STR(msg, str) { \
|
#define XML_GET_VAR_STR(msg, str) { \
|
||||||
int size; \
|
int size, prev_size = -1; \
|
||||||
int chars; \
|
int chars; \
|
||||||
char *larger; \
|
char *larger; \
|
||||||
va_list ap; \
|
va_list ap; \
|
||||||
@@ -35,8 +35,13 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED,
|
|||||||
va_start(ap, msg); \
|
va_start(ap, msg); \
|
||||||
chars = vsnprintf(str, size, msg, ap); \
|
chars = vsnprintf(str, size, msg, ap); \
|
||||||
va_end(ap); \
|
va_end(ap); \
|
||||||
if ((chars > -1) && (chars < size)) \
|
if ((chars > -1) && (chars < size)) { \
|
||||||
break; \
|
if (prev_size == chars) { \
|
||||||
|
break; \
|
||||||
|
} else { \
|
||||||
|
prev_size = chars; \
|
||||||
|
} \
|
||||||
|
} \
|
||||||
if (chars > -1) \
|
if (chars > -1) \
|
||||||
size += chars + 1; \
|
size += chars + 1; \
|
||||||
else \
|
else \
|
||||||
|
Reference in New Issue
Block a user