[gnumeric] Avoid passing NULL arguments to strcmp.
- From: J.H.M. Dassen (Ray) <jdassen src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Avoid passing NULL arguments to strcmp.
- Date: Mon, 13 Sep 2010 11:12:02 +0000 (UTC)
commit 5482609f24dccdc210529ee2efc29be13535293d
Author: J.H.M. Dassen (Ray) <jdassen debian org>
Date: Mon Sep 13 13:10:35 2010 +0200
Avoid passing NULL arguments to strcmp.
plugins/openoffice/openoffice-read.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/plugins/openoffice/openoffice-read.c b/plugins/openoffice/openoffice-read.c
index 72c1039..73c825e 100644
--- a/plugins/openoffice/openoffice-read.c
+++ b/plugins/openoffice/openoffice-read.c
@@ -6645,8 +6645,8 @@ odf_button_event_listener (GsfXMLIn *xin, xmlChar const **attrs)
OO_NS_SCRIPT, "macro-name"))
macro_name = CXML2C (attrs[1]);
- if (0 == strcmp (event_name, "dom:mousedown") &&
- 0 == strcmp (language, "gnm:short-macro") &&
+ if (event_name && (0 == strcmp (event_name, "dom:mousedown")) &&
+ language && (0 == strcmp (language, "gnm:short-macro")) &&
g_str_has_prefix (macro_name, "set-to-TRUE:"))
state->cur_control->linked_cell = g_strdup (macro_name + 12);
}
@@ -6669,8 +6669,9 @@ odf_control_property (GsfXMLIn *xin, xmlChar const **attrs)
OO_NS_OFFICE, "string-value"))
value = CXML2C (attrs[1]);
- if (0 == strcmp (property_name, "gnm:label") &&
- NULL != value)
+ if ((property_name != NULL) &&
+ (0 == strcmp (property_name, "gnm:label")) &&
+ (NULL != value))
state->cur_control->label = g_strdup (value);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]