]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Print XML parse errors correctly
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 7 Oct 2016 18:19:35 +0000 (19:19 +0100)
committerSimon McVittie <smcv@debian.org>
Thu, 13 Oct 2016 21:44:12 +0000 (22:44 +0100)
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
bus/config-loader-expat.c

index 901969734c3c9351f5ac583c9c8bcb527d5f5fdf..f59942e32d6f1ce7f6fcc8337cb6ff181e90065c 100644 (file)
@@ -254,10 +254,13 @@ bus_config_load (const DBusString      *file,
               dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
             else
               dbus_set_error (error, DBUS_ERROR_FAILED,
-                              "Error in file %s, line %d, column %d: %s\n",
+                              "Error in file %s, line %lu, column %lu: %s\n",
                               filename,
-                              XML_GetCurrentLineNumber (expat),
-                              XML_GetCurrentColumnNumber (expat),
+                              /* The XML_Size type varies according to
+                               * build options, so cast to something we can
+                               * cope with. */
+                              (unsigned long) XML_GetCurrentLineNumber (expat),
+                              (unsigned long) XML_GetCurrentColumnNumber (expat),
                               XML_ErrorString (e));
           }