Mercurial > pidgin.yaz
comparison src/util.c @ 765:bf31bf916f53
[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 <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 25 Aug 2000 05:04:41 +0000 |
parents | a566fc987db9 |
children | be917c4d3e39 |
comparison
equal
deleted
inserted
replaced
764:a566fc987db9 | 765:bf31bf916f53 |
---|---|
1105 } | 1105 } |
1106 | 1106 |
1107 return; | 1107 return; |
1108 } | 1108 } |
1109 | 1109 |
1110 void stylize(gchar *text, int length) | 1110 char *stylize(gchar *text, int length) |
1111 { | 1111 { |
1112 gchar *buf; | 1112 gchar *buf; |
1113 char tmp[length]; | |
1113 | 1114 |
1114 buf = g_malloc(length); | 1115 buf = g_malloc(length); |
1116 g_snprintf(buf, length, "%s", text); | |
1115 | 1117 |
1116 if (font_options & OPT_FONT_FACE) | 1118 if (font_options & OPT_FONT_FACE) |
1117 { | 1119 { |
1118 g_snprintf(buf, length, "<FONT FACE=\"%s\">%s</FONT>", fontface, text); | 1120 g_snprintf(tmp, length, "<FONT FACE=\"%s\">%s</FONT>", fontface, buf); |
1119 strcpy(text, buf); | 1121 strcpy(buf, tmp); |
1120 } | 1122 } |
1121 | 1123 |
1122 if (font_options & OPT_FONT_FGCOL) | 1124 if (font_options & OPT_FONT_FGCOL) |
1123 { | 1125 { |
1124 g_snprintf(buf, length, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", fgcolor.red, fgcolor.green, fgcolor.blue, text); | 1126 g_snprintf(tmp, length, "<FONT COLOR=\"#%02X%02X%02X\">%s</FONT>", fgcolor.red, fgcolor.green, fgcolor.blue, buf); |
1125 strcpy(text, buf); | 1127 strcpy(buf, tmp); |
1126 } | 1128 } |
1127 | 1129 |
1128 if (font_options & OPT_FONT_BGCOL) | 1130 if (font_options & OPT_FONT_BGCOL) |
1129 { | 1131 { |
1130 g_snprintf(buf, length, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", bgcolor.red, bgcolor.green, bgcolor.blue, text); | 1132 g_snprintf(tmp, length, "<BODY BGCOLOR=\"#%02X%02X%02X\">%s</BODY>", bgcolor.red, bgcolor.green, bgcolor.blue, buf); |
1131 strcpy(text, buf); | 1133 strcpy(buf, tmp); |
1132 } | 1134 } |
1133 | 1135 |
1134 g_free(buf); | 1136 return buf; |
1135 } | 1137 } |