comparison src/protocols/jabber/buddy.c @ 11127:719779387f96

[gaim-migrate @ 13183] Change the base16 and base64 functions to use better data types, and make appropriate changes to other parts of the Gaim code to get rid of a few warnings and hopefully make things more correct. In other news, why is CVS HEAD crashing for me on exit? committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 19 Jul 2005 05:15:45 +0000
parents cef48e318125
children 096020ae09a9
comparison
equal deleted inserted replaced
11126:2a3568cbd8a6 11127:719779387f96
383 unsigned char *avatar_data; 383 unsigned char *avatar_data;
384 gsize avatar_len; 384 gsize avatar_len;
385 385
386 if(avatar_file && g_file_get_contents(avatar_file, (gchar **)&avatar_data, &avatar_len, &error)) { 386 if(avatar_file && g_file_get_contents(avatar_file, (gchar **)&avatar_data, &avatar_len, &error)) {
387 xmlnode *photo, *binval; 387 xmlnode *photo, *binval;
388 unsigned char *enc; 388 gchar *enc;
389 int i; 389 int i;
390 unsigned char hashval[20]; 390 unsigned char hashval[20];
391 char *p, hash[41]; 391 char *p, hash[41];
392 392
393 photo = xmlnode_new_child(vc_node, "PHOTO"); 393 photo = xmlnode_new_child(vc_node, "PHOTO");
807 !strcmp(child->name, "LOGO")) { 807 !strcmp(child->name, "LOGO")) {
808 char *bintext = NULL; 808 char *bintext = NULL;
809 xmlnode *binval; 809 xmlnode *binval;
810 if((binval = xmlnode_get_child(child, "BINVAL")) && 810 if((binval = xmlnode_get_child(child, "BINVAL")) &&
811 (bintext = xmlnode_get_data(binval))) { 811 (bintext = xmlnode_get_data(binval))) {
812 int size, i; 812 gsize size;
813 guint8 *data;
814 int i;
813 unsigned char hashval[20]; 815 unsigned char hashval[20];
814 char *data, *p, hash[41]; 816 char *p, hash[41];
815 gboolean photo = (strcmp(child->name, "PHOTO") == 0); 817 gboolean photo = (strcmp(child->name, "PHOTO") == 0);
816 818
817 gaim_base64_decode(text, &data, &size); 819 data = gaim_base64_decode(text, &size);
818 820
819 imgids = g_slist_prepend(imgids, GINT_TO_POINTER(gaim_imgstore_add(data, size, "logo.png"))); 821 imgids = g_slist_prepend(imgids, GINT_TO_POINTER(gaim_imgstore_add(data, size, "logo.png")));
820 g_string_append_printf(info_text, 822 g_string_append_printf(info_text,
821 "<b>%s:</b> <img id='%d'><br/>", 823 "<b>%s:</b> <img id='%d'><br/>",
822 photo ? _("Photo") : _("Logo"), 824 photo ? _("Photo") : _("Logo"),