[gnumeric] stf: fix problem with spaces.



commit a090edea9532a53c8506f6faba1c96053de17816
Author: Morten Welinder <terra gnome org>
Date:   Mon Feb 21 18:30:50 2011 -0500

    stf: fix problem with spaces.

 ChangeLog       |    3 +++
 NEWS            |    1 +
 src/stf-parse.c |    2 +-
 3 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c8471b7..6f7d648 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2011-02-21  Morten Welinder  <terra gnome org>
 
+	* src/stf-parse.c (trim_spaces_inplace): Don't use strcpy for
+	overlapping areas.  Hopefully fixes #642477.
+
 	* src/wbc-gtk.c (wbc_gtk_finalize): Cancel template loader handler
 	if necessary.
 	(wbc_gtk_create_notebook_area): Hold a ref to bnotebook so it
diff --git a/NEWS b/NEWS
index 0244c9c..c940a17 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,7 @@ Morten:
 	* Fix problem with single-cell names and 'r'-type arguments.  [#613273]
 	* Plug a few leaks.
 	* Fix potential crash on quick exit.
+	* Fix stf import problem diagnosed by Andreas.  [#642477]
 
 --------------------------------------------------------------------------
 Gnumeric 1.10.13
diff --git a/src/stf-parse.c b/src/stf-parse.c
index b39607a..0e3f470 100644
--- a/src/stf-parse.c
+++ b/src/stf-parse.c
@@ -469,7 +469,7 @@ trim_spaces_inplace (char *field, StfParseOptions_t const *parseoptions)
 			s = g_utf8_next_char (s);
 
 		if (s != field)
-			strcpy (field, s);
+			memmove (field, s, 1 + strlen (s));
 	}
 
 	if (parseoptions->trim_spaces & TRIM_TYPE_RIGHT) {



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