summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2015-05-28 12:44:07 +0100
committerRichard Hughes <richard@hughsie.com>2015-05-28 12:44:07 +0100
commit9dc1ab93dbd76f09d96a163f8df80451b5e1e8af (patch)
tree737292119a8b4f2f60eae9bf3c5bdcc8658a508f
parentd4bc79e49399fa98b6158ef2b192e1409973852f (diff)
downloadappstream-glib-9dc1ab93dbd76f09d96a163f8df80451b5e1e8af.tar.gz
Fix a potential crash spotted by clang
-rw-r--r--libappstream-glib/as-app-desktop.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libappstream-glib/as-app-desktop.c b/libappstream-glib/as-app-desktop.c
index 1f84b34..a122867 100644
--- a/libappstream-glib/as-app-desktop.c
+++ b/libappstream-glib/as-app-desktop.c
@@ -40,7 +40,7 @@ as_app_desktop_key_get_locale (const gchar *key)
if (tmp1 == NULL)
return NULL;
tmp2 = g_strstr_len (tmp1, -1, "]");
- if (tmp1 == NULL)
+ if (tmp2 == NULL)
return NULL;
locale = g_strdup (tmp1 + 1);
locale[tmp2 - tmp1 - 1] = '\0';