[goffice] go_string_replace: fix precondition.



commit a000b9476a6ec400882f39c54501c61f61af0314
Author: Morten Welinder <terra gnome org>
Date:   Fri Aug 20 14:54:29 2010 -0400

    go_string_replace: fix precondition.

 ChangeLog                      |    5 +++++
 NEWS                           |    1 +
 goffice/utils/go-glib-extras.c |    2 +-
 3 files changed, 7 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 4e505d8..a53029b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2010-08-20  Morten Welinder  <terra gnome org>
+
+	* goffice/utils/go-glib-extras.c (go_string_replace): pos==len is
+	ok.
+
 2010-08-20  Jean Brefort  <jean brefort normalesup org>
 
 	* goffice/graph/gog-chart-map.c (make_path_cspline): do not check order
diff --git a/NEWS b/NEWS
index 7c53ce2..a20858c 100644
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,7 @@ Jean:
 
 Morten:
 	* Limit formats to sane number of decimals.  [#627066]
+	* Fix minor go_string_replace issue.
 
 --------------------------------------------------------------------------
 goffice 0.8.9:
diff --git a/goffice/utils/go-glib-extras.c b/goffice/utils/go-glib-extras.c
index ff8cca6..e385483 100644
--- a/goffice/utils/go-glib-extras.c
+++ b/goffice/utils/go-glib-extras.c
@@ -339,7 +339,7 @@ go_string_replace (GString *target,
 
 	g_return_if_fail (target != NULL);
 	g_return_if_fail (pos >= 0);
-	g_return_if_fail (pos < target->len);
+	g_return_if_fail (pos <= target->len);
 
 	if (oldlen < 0)
 		oldlen = target->len - pos;



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