diff src/prpl.c @ 1443:336fc98b7f90

[gaim-migrate @ 1453] ha! take that, foul knave committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Mon, 29 Jan 2001 02:53:40 +0000
parents f6a9bd50fd19
children c6f9d0cdaa00
line wrap: on
line diff
--- a/src/prpl.c	Mon Jan 29 01:57:37 2001 +0000
+++ b/src/prpl.c	Mon Jan 29 02:53:40 2001 +0000
@@ -55,10 +55,19 @@
 	return a->protocol - b->protocol;
 }
 
-void load_protocol(proto_init pi)
+void load_protocol(proto_init pi, int size)
 {
-	struct prpl *p = g_new0(struct prpl, 1);
+	struct prpl *p;
 	struct prpl *old;
+	if (size != sizeof(struct prpl)) {
+		do_error_dialog(_("You have attempted to load a protocol which was not compiled"
+				" from the same version of the source as this application was."
+				" Unfortunately, because it is not the same version I cannot"
+				" safely tell you which one it was. Needless to say, it was not"
+				" successfully loaded."), _("Protocol Error"));
+		return;
+	}
+	p = g_new0(struct prpl, 1);
 	pi(p);
 	if ((old = find_prpl(p->protocol)) == NULL)
 		unload_protocol(old);
@@ -90,8 +99,8 @@
 
 void static_proto_init()
 {
-	load_protocol(toc_init);
-	load_protocol(oscar_init);
+	load_protocol(toc_init, sizeof(struct prpl));
+	load_protocol(oscar_init, sizeof(struct prpl));
 }
 
 static void des_win(GtkWidget *a, GtkWidget *b)