# HG changeset patch # User Eric Warmenhoven # Date 980736820 0 # Node ID 336fc98b7f90590e1b90175d1126452d8138556b # Parent 2f4e6269b001b0f51171c7db4eb4b2c8a760e056 [gaim-migrate @ 1453] ha! take that, foul knave committer: Tailor Script diff -r 2f4e6269b001 -r 336fc98b7f90 plugins/icq/gaim_icq.c --- a/plugins/icq/gaim_icq.c Mon Jan 29 01:57:37 2001 +0000 +++ b/plugins/icq/gaim_icq.c Mon Jan 29 02:53:40 2001 +0000 @@ -481,7 +481,7 @@ } char *gaim_plugin_init(GModule *handle) { - load_protocol(icq_init); + load_protocol(icq_init, sizeof(struct prpl)); return NULL; } diff -r 2f4e6269b001 -r 336fc98b7f90 plugins/irc.c --- a/plugins/irc.c Mon Jan 29 01:57:37 2001 +0000 +++ b/plugins/irc.c Mon Jan 29 02:53:40 2001 +0000 @@ -1131,7 +1131,7 @@ char *gaim_plugin_init(GModule * handle) { - load_protocol(irc_init); + load_protocol(irc_init, sizeof(struct prpl)); return NULL; } diff -r 2f4e6269b001 -r 336fc98b7f90 plugins/jabber/jabber.c --- a/plugins/jabber/jabber.c Mon Jan 29 01:57:37 2001 +0000 +++ b/plugins/jabber/jabber.c Mon Jan 29 02:53:40 2001 +0000 @@ -883,7 +883,7 @@ char *gaim_plugin_init(GModule *handle) { - load_protocol(Jabber_init); + load_protocol(Jabber_init, sizeof(struct prpl)); return NULL; } diff -r 2f4e6269b001 -r 336fc98b7f90 plugins/msn/msn.c --- a/plugins/msn/msn.c Mon Jan 29 01:57:37 2001 +0000 +++ b/plugins/msn/msn.c Mon Jan 29 02:53:40 2001 +0000 @@ -883,7 +883,7 @@ char *gaim_plugin_init(GModule * handle) { - load_protocol(msn_init); + load_protocol(msn_init, sizeof(struct prpl)); return NULL; } diff -r 2f4e6269b001 -r 336fc98b7f90 plugins/napster.c --- a/plugins/napster.c Mon Jan 29 01:57:37 2001 +0000 +++ b/plugins/napster.c Mon Jan 29 02:53:40 2001 +0000 @@ -1187,7 +1187,7 @@ char *gaim_plugin_init(GModule * handle) { - load_protocol(nap_init); + load_protocol(nap_init, sizeof(struct prpl)); return NULL; } diff -r 2f4e6269b001 -r 336fc98b7f90 plugins/yay/yay.c --- a/plugins/yay/yay.c Mon Jan 29 01:57:37 2001 +0000 +++ b/plugins/yay/yay.c Mon Jan 29 02:53:40 2001 +0000 @@ -519,7 +519,7 @@ } char *gaim_plugin_init(GModule *handle) { - load_protocol(Yahoo_init); + load_protocol(Yahoo_init, sizeof(struct prpl)); return NULL; } diff -r 2f4e6269b001 -r 336fc98b7f90 src/prpl.c --- 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) diff -r 2f4e6269b001 -r 336fc98b7f90 src/prpl.h --- a/src/prpl.h Mon Jan 29 01:57:37 2001 +0000 +++ b/src/prpl.h Mon Jan 29 02:53:40 2001 +0000 @@ -113,7 +113,7 @@ void static_proto_init(); /* this is what should actually load the protocol. pass it the protocol's initializer */ -void load_protocol(proto_init); +void load_protocol(proto_init, int); void unload_protocol(struct prpl *); struct prpl *find_prpl(int);