summary refs log tree commit diff stats
path: root/src/fe-gtk/xtext.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fe-gtk/xtext.c')
-rw-r--r--src/fe-gtk/xtext.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/fe-gtk/xtext.c b/src/fe-gtk/xtext.c
index 1798647e..fef00c51 100644
--- a/src/fe-gtk/xtext.c
+++ b/src/fe-gtk/xtext.c
@@ -4718,10 +4718,8 @@ gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len, time_t stamp)
 
 	ent = g_malloc (len + 1 + sizeof (textentry));
 	ent->str = (unsigned char *) ent + sizeof (textentry);
-	ent->str_len = len;
-	if (len)
-		memcpy (ent->str, text, len);
-	ent->str[len] = 0;
+	safe_strcpy (ent->str, text, len);
+	ent->str_len = strlen (ent->str); /* Possibly truncated */
 	ent->indent = 0;
 	ent->left_len = -1;