From 9983fe74dd7eae1fac17bafa31ae44995ce28769 Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 14 Nov 2012 15:20:58 +0100 Subject: [PATCH] Don't SIGSEGV if no transport is used. One of previous commits (74b1b62510d939) allowed us to connect to localhost directly if ssh transport was used. However, if there's not transport, we SIGSEGV'ed as g_str_equal doesn't like NULL as one of arguments. Change this to g_strcmp0 which does the same service but is more friendly to NULL arguments. --- src/virt-viewer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/virt-viewer.c b/src/virt-viewer.c index a0d530e..aedbf73 100644 --- a/src/virt-viewer.c +++ b/src/virt-viewer.c @@ -376,7 +376,7 @@ virt_viewer_extract_connect_info(VirtViewer *self, */ if (virt_viewer_replace_host(ghost)) { gchar *replacement_host = NULL; - if (g_str_equal(transport, "ssh")) { + if (g_strcmp0(transport, "ssh") == 0) { replacement_host = g_strdup("localhost"); } else { replacement_host = g_strdup(host);