diff --git a/ChangeLog b/ChangeLog index 157a1981..304e86a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ +Fri Oct 28 10:24:39 CEST 2005 Daniel Veillard + + * error.c: fixing a portability problem on some old Unices with + patch from Albert Chin + 2005-10-27 Aleksey Sanin + * c14n.c result/c14n/exc-without-comments/test-2 test/c14n/exc-without-comments/test-2.xml test/c14n/exc-without-comments/test-2.xpath: fixing diff --git a/error.c b/error.c index 0770273d..722ffbb5 100644 --- a/error.c +++ b/error.c @@ -21,7 +21,7 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, ...); #define XML_GET_VAR_STR(msg, str) { \ - int size; \ + int size, prev_size = -1; \ int chars; \ char *larger; \ va_list ap; \ @@ -35,8 +35,13 @@ void XMLCDECL xmlGenericErrorDefaultFunc (void *ctx ATTRIBUTE_UNUSED, va_start(ap, msg); \ chars = vsnprintf(str, size, msg, ap); \ va_end(ap); \ - if ((chars > -1) && (chars < size)) \ - break; \ + if ((chars > -1) && (chars < size)) { \ + if (prev_size == chars) { \ + break; \ + } else { \ + prev_size = chars; \ + } \ + } \ if (chars > -1) \ size += chars + 1; \ else \