changeset 27189:55811a205c71

NULL terminate some strings. Hopefully stop Yahoo texting crashes. Thanks darkrain42 for helping with the solution.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Fri, 12 Jun 2009 21:00:44 +0000
parents 710cb8df1b69
children 38c4973b5222 0200eaa7acc3
files libpurple/protocols/yahoo/yahoo.c
diffstat 1 files changed, 2 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Thu Jun 11 10:45:39 2009 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Fri Jun 12 21:00:44 2009 +0000
@@ -4172,10 +4172,8 @@
 			struct yahoo_sms_carrier_cb_data *sms_cb_data;
 			sms_cb_data = g_malloc(sizeof(struct yahoo_sms_carrier_cb_data));
 			sms_cb_data->gc = gc;
-			sms_cb_data->who = g_malloc(strlen(who));
-			sms_cb_data->what = g_malloc(strlen(what));
-			strcpy(sms_cb_data->who, who);
-			strcpy(sms_cb_data->what, what);
+			sms_cb_data->who = g_strdup(who);
+			sms_cb_data->what = g_strdup(what);
 
 			purple_conversation_write(conv, NULL, "Getting mobile carrier to send the sms", PURPLE_MESSAGE_SYSTEM, time(NULL));