From: Mark D. <the...@us...> - 2003-07-07 02:59:16
|
Update of /cvsroot/gaim/gaim/src/protocols/oscar In directory sc8-pr-cvs1:/tmp/cvs-serv10224/src/protocols/oscar Modified Files: oscar.c Log Message: This should fix a somewhat rare ICQ crash. http://sourceforge.net/tracker/index.php?func=detail&aid=749156&group_id=235&atid=100235 Index: oscar.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/oscar/oscar.c,v retrieving revision 1.406 retrieving revision 1.407 diff -u -d -r1.406 -r1.407 --- oscar.c 6 Jul 2003 06:57:42 -0000 1.406 +++ oscar.c 7 Jul 2003 02:59:13 -0000 1.407 @@ -2535,7 +2535,7 @@ GaimConnection *gc = sess->aux_data; gchar **msg1, **msg2; GError *err = NULL; - int i; + int i, numtoks; if (!args->type || !args->msg || !args->uin) return 1; @@ -2545,7 +2545,8 @@ /* Split up the message at the delimeter character, then convert each string to UTF-8 */ msg1 = g_strsplit(args->msg, "\376", 0); - msg2 = (gchar **)g_malloc(10*sizeof(gchar *)); /* XXX - 10 is a guess */ + for (numtoks=0; msg1[numtoks]; numtoks++); + msg2 = (gchar **)g_malloc((numtoks+1)*sizeof(gchar *)); for (i=0; msg1[i]; i++) { strip_linefeed(msg1[i]); msg2[i] = g_convert(msg1[i], strlen(msg1[i]), "UTF-8", "ISO-8859-1", NULL, NULL, &err); |