[recipes] logging: Be safe against unset log domains
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [recipes] logging: Be safe against unset log domains
- Date: Wed, 14 Jun 2017 18:31:59 +0000 (UTC)
commit 120cfdfdfa350b7d97185a79bfbcf549666d5878
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Jun 14 14:14:51 2017 -0400
logging: Be safe against unset log domains
This was causing crashes for debug logging out of gnome-autoar.
src/gr-logging.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/src/gr-logging.c b/src/gr-logging.c
index d61e3c2..e3151cd 100644
--- a/src/gr-logging.c
+++ b/src/gr-logging.c
@@ -69,8 +69,9 @@ gr_log_writer (GLogLevelFlags log_level,
}
}
- if (!verbose_logging || strcmp (log_domain, G_LOG_DOMAIN) != 0) {
- if (strcmp (domains, "all") != 0 &&
+ if (!verbose_logging || g_strcmp0 (log_domain, G_LOG_DOMAIN) != 0) {
+ if (domains != NULL &&
+ strcmp (domains, "all") != 0 &&
(log_domain == NULL || !strstr (domains, log_domain)))
return G_LOG_WRITER_HANDLED;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]