]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
GHI/X11: Don't pass NULL to strcmp.
authorVMware, Inc <>
Thu, 24 Feb 2011 22:42:29 +0000 (14:42 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 24 Feb 2011 22:42:29 +0000 (14:42 -0800)
Xdg_DetectDesktopEnv may return NULL, so its return value shouldn't be
passed to strcmp unchecked.  Rather than checking ourselves, we'll
just g_strcmp0 do it for us.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/services/plugins/unity/ghIntegration/platform.cc

index f0c306c2f8e7c02f4d68d98212cb125228e2f8ac..44b4f4447889d90a63a30ff03b85949f3cdafa52 100644 (file)
@@ -240,7 +240,8 @@ Bool
 GHIPlatformIsSupported(void)
 {
    const char *desktopEnv = Xdg_DetectDesktopEnv();
-   return (strcmp(desktopEnv, "GNOME") == 0) || (strcmp(desktopEnv, "KDE") == 0);
+   return    (g_strcmp0(desktopEnv, "GNOME") == 0)
+          || (g_strcmp0(desktopEnv, "KDE") == 0);
 }