diff src/server.c @ 1771:213607e89598

[gaim-migrate @ 1781] plug mem leak. don't show evil level if it decreased. mid's utf8 patch for jabber. my girlfriend got an accounting calculator today, you know, with the paper and the printing and things. it's kinda loud. she's really happy about having it. she had bought a different one yesterday but it didn't work so we returned it today. we also went to Albertson's and bought groceries. we bought 72 cans of soda for $15. That's 20 cents per soda. Not bad. we also bought a cow; i'm going to cook it tonight. ben&jerry's ice cream is good. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 30 Apr 2001 01:25:30 +0000
parents 68eddf56f419
children 896432d66303
line wrap: on
line diff
--- a/src/server.c	Sun Apr 29 01:33:09 2001 +0000
+++ b/src/server.c	Mon Apr 30 01:25:30 2001 +0000
@@ -541,16 +541,21 @@
 
 void serv_got_eviled(struct gaim_connection *gc, char *name, int lev)
 {
-	char *buf2 = g_malloc(1024);
+	char buf2[1024];
 	GtkWidget *d, *label, *close;
 
-
 	plugin_event(event_warned, gc, name, (void *)lev, 0);
 
-	g_snprintf(buf2, 1023, "%s has just been warned by %s.\nYour new warning level is %d%%",
+	if (gc->evil > lev) {
+		gc->evil = lev;
+		return;
+	}
+
+	gc->evil = lev;
+
+	g_snprintf(buf2, sizeof(buf2), "%s has just been warned by %s.\nYour new warning level is %d%%",
 		   gc->username, ((name == NULL)? "an anonymous person" : name), lev);
 
-
 	d = gtk_dialog_new();
 	gtk_widget_realize(d);
 	aol_icon(d->window);