[glib/wip/ernestask/gcc-9-null-directive-argument] gdbus: Avoid printing null strings



commit 4bed8697f71c73905943b4e3ae3a2f6ad423f64e
Author: Ernestas Kulik <ekulik redhat com>
Date:   Tue Jan 29 09:50:46 2019 +0100

    gdbus: Avoid printing null strings
    
    Fixes things coming from GCC 9 like (when building 2.56.1):
    
    gdbusauth.c:1302:11: error: '%s' directive argument is null [-Werror=format-overflow=]

 gio/gdbusauth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gio/gdbusauth.c b/gio/gdbusauth.c
index 1f8ea8057..752ec23fc 100644
--- a/gio/gdbusauth.c
+++ b/gio/gdbusauth.c
@@ -1272,9 +1272,9 @@ _g_dbus_auth_run_server (GDBusAuth              *auth,
                                                     &line_length,
                                                     cancellable,
                                                     error);
-          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
           if (line == NULL)
             goto out;
+          debug_print ("SERVER: WaitingForBegin, read '%s'", line);
           if (g_strcmp0 (line, "BEGIN") == 0)
             {
               /* YAY, done! */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]