libunique: fix build with gcc-7 by fixing a bug

This commit is contained in:
Vladimír Čunát
2018-02-18 10:35:46 +01:00
parent e202018d1f
commit 64db4f7a57
2 changed files with 21 additions and 2 deletions
@@ -0,0 +1,18 @@
gcc-7 newly detects this class of bugs.
In this particular case it's clear that the inention was
to detect if the string is non-NULL *and* non-empty.
diff --git a/unique/uniqueapp.c b/unique/uniqueapp.c
index b40a86c..66a7226 100644
--- a/unique/uniqueapp.c
+++ b/unique/uniqueapp.c
@@ -176,7 +176,7 @@ set_startup_id (UniqueBackend *backend,
{
gchar *id;
- if (startup_id && startup_id != '\0')
+ if (startup_id && *startup_id != '\0')
id = g_strdup (startup_id);
else
{