[glib/glib-2-54-os-x-mimetype-fixes-793137: 5/7] gio: Eliminate warnings in cstring conversion on OS X
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-54-os-x-mimetype-fixes-793137: 5/7] gio: Eliminate warnings in cstring conversion on OS X
- Date: Thu, 22 Feb 2018 13:04:26 +0000 (UTC)
commit 9076d51301bf115dc66dd3348fa537baee34e0b1
Author: Jiří Techet <techet gmail com>
Date: Sun Oct 22 12:12:59 2017 +0200
gio: Eliminate warnings in cstring conversion on OS X
create_cstr_from_cfstring_with_fallback() is allowed to be called when str == NULL
but create_cstr_from_cfstring() isn't which leads to warnings in the console.
Fix this by adding NULL checks into create_cstr_from_cfstring_with_fallback().
https://bugzilla.gnome.org/show_bug.cgi?id=788936
gio/gosxcontenttype.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gio/gosxcontenttype.c b/gio/gosxcontenttype.c
index b646f6e57..347477577 100644
--- a/gio/gosxcontenttype.c
+++ b/gio/gosxcontenttype.c
@@ -90,9 +90,10 @@ static gchar *
create_cstr_from_cfstring_with_fallback (CFStringRef str,
const gchar *fallback)
{
- gchar *cstr;
+ gchar *cstr = NULL;
- cstr = create_cstr_from_cfstring (str);
+ if (str)
+ cstr = create_cstr_from_cfstring (str);
if (!cstr)
return g_strdup (fallback);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]