]> granicus.if.org Git - libexpat/commitdiff
Use correct format for XML_Char in error output
authorRhodri James <rhodri@kynesim.co.uk>
Fri, 25 Aug 2017 11:39:32 +0000 (12:39 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 29 Aug 2017 21:19:35 +0000 (23:19 +0200)
Only actually invoked when XML_Char is char, but it keeps the
compiler quiet

expat/tests/chardata.c

index 9a93f597fd7f1668a0af026648ad45b5071c309b..07216aaefe208e93b14b7e2ebabebf81bbfdaeea 100644 (file)
 
 #include "chardata.h"
 
+#ifdef XML_UNICODE_WCHAR_T
+#define XML_FMT_STR "ls"
+#else
+#define XML_FMT_STR "s"
+#endif
 
 static int
 xmlstrlen(const XML_Char *s)
@@ -115,7 +120,8 @@ CharData_CheckString(CharData *storage, const char *expected)
     if (len != count) {
         if (sizeof(XML_Char) == 1)
             sprintf(buffer, "wrong number of data characters:"
-                    " got %d, expected %d:\n%s", count, len, storage->data);
+                    " got %d, expected %d:\n%" XML_FMT_STR,
+                    count, len, storage->data);
         else
             sprintf(buffer,
                     "wrong number of data characters: got %d, expected %d",