aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2015-01-27 09:19:41 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2015-01-27 09:19:41 +0000
commitdc3e933ec4b73ac93ae866bb979f02045181a17f (patch)
tree6c5945917e1f00b2f828ab00d8094ec1c120f387
parent85169b54a4751438ebb9bbcede57bb45ee4e7ab4 (diff)
fixed gtkut_text_buffer_insert_with_tag_by_name().
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@3462 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--src/gtkutils.c2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c4cdb3a..85b6cf44 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2015-01-16
+ * src/gtkutils.c: gtkut_text_buffer_insert_with_tag_by_name():
+ guard against the case of len == 0 (#215).
+
+2015-01-16
+
* src/mainwindow.c: main_window_window_state_cb():
win32: fixed a bug that maximized state was unset on minimize.
diff --git a/src/gtkutils.c b/src/gtkutils.c
index 8240acc3..8258094d 100644
--- a/src/gtkutils.c
+++ b/src/gtkutils.c
@@ -965,7 +965,7 @@ void gtkut_text_buffer_insert_with_tag_by_name(GtkTextBuffer *buffer,
gtk_text_buffer_insert_with_tags_by_name
(buffer, iter, text, len, tag, NULL);
- if (text[len - 1] != '\n') {
+ if (len > 0 && text[len - 1] != '\n') {
/* somehow returns invalid value first (bug?),
so call it twice */
gtk_text_iter_get_chars_in_line(iter);