]> birchwood-abbey.net Git - mit-scheme.git/commitdiff
gtk: Handle NULLs from current_gpollfds_string()
authorMatt Birkholz <matt@birchwood-abbey.net>
Fri, 28 Oct 2022 00:11:31 +0000 (17:11 -0700)
committerMatt Birkholz <matt@birchwood-abbey.net>
Fri, 28 Oct 2022 00:11:31 +0000 (17:11 -0700)
in gtk_slice_hook.

src/gtk/gtkio.c

index 653176d590f41bc0731ef8459f2f1082477dd2a8..5129aa5a34a0b0c941f959c325c79d08725366d1 100644 (file)
@@ -53,8 +53,8 @@ gtk_slice_hook (void)
       gtk_label_set_text (GTK_LABEL (slice_label), text);
       g_free (text);
       fdstr = current_gpollfds_string ();
-      text = g_strdup_printf ("Channels:%s", fdstr);
-      if (fdstr[0] != '\0')
+      text = g_strdup_printf ("Channels:%s", fdstr == NULL ? " none" : fdstr);
+      if (fdstr != NULL)
        g_free (fdstr);
       gtk_label_set_text (GTK_LABEL (status_label), text);
       g_free (text);