changeset 17767:c529c95e7733

Size the formatting string first, to avoid unnecessary resizing.
author Richard Laager <rlaager@wiktel.com>
date Thu, 07 Jun 2007 05:25:20 +0000
parents beeef78409b2
children a6594c34635b
files libpurple/plugins/log_reader.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/plugins/log_reader.c	Thu Jun 07 05:23:31 2007 +0000
+++ b/libpurple/plugins/log_reader.c	Thu Jun 07 05:25:20 2007 +0000
@@ -1460,7 +1460,7 @@
 	read = escaped;
 
 	/* Apply formatting... */
-	formatted = g_string_new("");
+	formatted = g_string_sized_new(strlen(read));
 	c = read;
 	line = read;
 	while (c)