# HG changeset patch # User Eric Warmenhoven # Date 967179881 0 # Node ID bf31bf916f536724317c32b2281c7a432551c766 # Parent a566fc987db9582068ea22633adb970d435da239 [gaim-migrate @ 775] no, if the away message gets modified, it'll be modified many many times. you won't notice it until you run out of space committer: Tailor Script diff -r a566fc987db9 -r bf31bf916f53 src/gaim.h --- a/src/gaim.h Fri Aug 25 04:17:06 2000 +0000 +++ b/src/gaim.h Fri Aug 25 05:04:41 2000 +0000 @@ -401,7 +401,7 @@ #define TYPE_SIGNOFF 4 #define TYPE_KEEPALIVE 5 -#define REVISION "gaim:$Revision: 774 $" +#define REVISION "gaim:$Revision: 775 $" #define FLAPON "FLAPON\r\n\r\n" #define ROAST "Tic/Toc" @@ -585,7 +585,7 @@ extern GtkWidget *picture_button2(GtkWidget *, char *, char **, short); extern void translate_lst (FILE *, char *); extern void translate_blt (FILE *, char *); -extern void stylize(gchar *, int); +extern char *stylize(gchar *, int); /* Functions in server.c */ /* input to serv */ diff -r a566fc987db9 -r bf31bf916f53 src/server.c --- a/src/server.c Fri Aug 25 04:17:06 2000 +0000 +++ b/src/server.c Fri Aug 25 05:04:41 2000 +0000 @@ -704,7 +704,7 @@ if (awaymessage != NULL) { time_t t; - char tmpmsg[BUF_LEN]; + char *tmpmsg; time(&t); @@ -718,9 +718,8 @@ is_idle = -1; /* apply default fonts and colors */ - stylize(awaymessage->message, MSG_LEN); + tmpmsg = stylize(awaymessage->message, MSG_LEN); - strcpy(tmpmsg, awaymessage->message); escape_text(tmpmsg); escape_message(tmpmsg); serv_send_im(name, away_subs(tmpmsg, name), 1); @@ -729,7 +728,8 @@ is_idle = 1; if (cnv != NULL) - write_to_conv(cnv, away_subs(awaymessage->message, name), WFLAG_SEND | WFLAG_AUTO, NULL); + write_to_conv(cnv, away_subs(tmpmsg, name), WFLAG_SEND | WFLAG_AUTO, NULL); + g_free(tmpmsg); } } diff -r a566fc987db9 -r bf31bf916f53 src/util.c --- a/src/util.c Fri Aug 25 04:17:06 2000 +0000 +++ b/src/util.c Fri Aug 25 05:04:41 2000 +0000 @@ -1107,29 +1107,31 @@ return; } -void stylize(gchar *text, int length) +char *stylize(gchar *text, int length) { gchar *buf; + char tmp[length]; buf = g_malloc(length); + g_snprintf(buf, length, "%s", text); if (font_options & OPT_FONT_FACE) { - g_snprintf(buf, length, "%s", fontface, text); - strcpy(text, buf); + g_snprintf(tmp, length, "%s", fontface, buf); + strcpy(buf, tmp); } if (font_options & OPT_FONT_FGCOL) { - g_snprintf(buf, length, "%s", fgcolor.red, fgcolor.green, fgcolor.blue, text); - strcpy(text, buf); + g_snprintf(tmp, length, "%s", fgcolor.red, fgcolor.green, fgcolor.blue, buf); + strcpy(buf, tmp); } if (font_options & OPT_FONT_BGCOL) { - g_snprintf(buf, length, "%s", bgcolor.red, bgcolor.green, bgcolor.blue, text); - strcpy(text, buf); + g_snprintf(tmp, length, "%s", bgcolor.red, bgcolor.green, bgcolor.blue, buf); + strcpy(buf, tmp); } - g_free(buf); -} \ No newline at end of file + return buf; +}