[goffice] Don't pass NULL to g_strtod(). [#735555]
- From: Jean Bréfort <jbrefort src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goffice] Don't pass NULL to g_strtod(). [#735555]
- Date: Thu, 28 Aug 2014 15:53:33 +0000 (UTC)
commit c74ea9a5d0e341e37018209ae3a9237f6596f753
Author: Jean Brefort <jean brefort normalesup org>
Date: Thu Aug 28 17:53:19 2014 +0200
Don't pass NULL to g_strtod(). [#735555]
ChangeLog | 5 +++++
NEWS | 1 +
goffice/data/go-data-simple.c | 9 ++++++++-
3 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 73cac13..d9c2875 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-08-28 Jean Brefort <jean brefort normalesup org>
+
+ * goffice/data/go-data-simple.c (go_data_vector_str_load_values),
+ (go_data_vector_str_get_value): don't pass NULL to g_strtod(). [#735555]
+
2014-08-27 Andreas J. Guelzow <aguelzow pyrshep ca>
* goffice/graph/gog-axis-color-map.c (save_name_cb): don't skip
diff --git a/NEWS b/NEWS
index ffe7238..91f71df 100644
--- a/NEWS
+++ b/NEWS
@@ -9,6 +9,7 @@ Jean:
* Fix font color theme support. [Debian 757611]
* Fix saving color maps when directory does not exists. [#735008]
* Fix color maps loading. [#735007]
+ * Don't pass NULL to g_strtod(). [#735555]
Morten:
* Work around gtk+ ABI break for colour selector. [#733350]
diff --git a/goffice/data/go-data-simple.c b/goffice/data/go-data-simple.c
index c733af6..aef5b26 100644
--- a/goffice/data/go-data-simple.c
+++ b/goffice/data/go-data-simple.c
@@ -661,6 +661,10 @@ go_data_vector_str_load_values (GODataVector *vec)
if (vec->values == NULL)
vec->values = g_new (double, strs->n);
while (i-- > 0) {
+ if (strs->str[i] == NULL) {
+ vec->values[i] = go_nan;
+ continue;
+ }
vec->values[i] = g_strtod (strs->str[i], &end);
if (*end) {
vec->values[i] = go_nan;
@@ -681,7 +685,10 @@ go_data_vector_str_get_value (GODataVector *vec, unsigned i)
{
char *end;
GODataVectorStr *strs = (GODataVectorStr *)vec;
- double d = g_strtod (strs->str[i], &end);
+ double d;
+ if (strs->str[i] == NULL)
+ return go_nan;
+ d = g_strtod (strs->str[i], &end);
return (*end)? go_nan: d;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]