[gnumeric] stf: fix UMR.



commit e86ea3144fafb4b886c24b86f2bee0796220723c
Author: Morten Welinder <terra gnome org>
Date:   Tue Jun 28 13:46:58 2016 -0400

    stf: fix UMR.

 ChangeLog       |    5 +++++
 src/stf-parse.c |    2 +-
 2 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8fe440e..b3f7392 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-28  Morten Welinder  <terra gnome org>
+
+       * src/stf-parse.c (stf_parse_options_guess_formats): Handle lines
+       of different lenghts.
+
 2016-06-21  Morten Welinder  <terra gnome org>
 
        * src/value.c (criteria_test_greater_or_equal): Use case-folding
diff --git a/src/stf-parse.c b/src/stf-parse.c
index e28b45d..8e51b93 100644
--- a/src/stf-parse.c
+++ b/src/stf-parse.c
@@ -1956,7 +1956,7 @@ stf_parse_options_guess_formats (StfParseOptions_t *po, char const *data)
 
                for (lno = sline; possible && lno < lines->len; lno++) {
                        GPtrArray *line = g_ptr_array_index (lines, lno);
-                       const char *data = g_ptr_array_index (line, col);
+                       const char *data = col < line->len ? g_ptr_array_index (line, col) : "";
                        unsigned prev_possible = possible;
 
                        if (*data == 0 || data[0] == '\'')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]