summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gtksourceview/gtksourcebufferoutputstream.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gtksourceview/gtksourcebufferoutputstream.c b/gtksourceview/gtksourcebufferoutputstream.c
index b3f8e1dd..60e59f66 100644
--- a/gtksourceview/gtksourcebufferoutputstream.c
+++ b/gtksourceview/gtksourcebufferoutputstream.c
@@ -652,7 +652,8 @@ validate_and_insert (GtkSourceBufferOutputStream *stream,
apply_error_tag (stream);
- if ((nvalid != len || !owned) && buffer[nvalid] != '\0')
+ if (!owned ||
+ (nvalid != len && buffer[nvalid] != '\0'))
{
/* make sure the buffer is always properly null
* terminated. This is needed, at least for now,