comparison libgaim/protocols/msn/msn-utils.c @ 20391:0b0ecee55091

The second msn.tgz from SF Patch #1621854 from Ka-Hing Cheung. "new version, fixes some crashes because group_id is char * but in some places it's set to an int (!). skadotnet, I don't understand why you need `if (!strcmp(type, "MFN")) {` in so many places, so I didn't include most of them. I also have different versions of some of your fixes because I already fixed them. Group manipulations may still not work, at least it's not crashing :-)" committer: Richard Laager <rlaager@wiktel.com>
author Ka-Hing Cheung <khc@hxbc.us>
date Sun, 15 Apr 2007 02:43:47 +0000
parents e354528c4163
children 9ba7dee775e1
comparison
equal deleted inserted replaced
20390:d634f88e25d8 20391:0b0ecee55091
24 #include "msn.h" 24 #include "msn.h"
25 #include "msn-utils.h" 25 #include "msn-utils.h"
26 #include "time.h" 26 #include "time.h"
27 //#include <openssl/md5.h> 27 //#include <openssl/md5.h>
28 28
29 char *rand_guid(void);
30
29 /************************************************************************** 31 /**************************************************************************
30 * Util 32 * Util
31 **************************************************************************/ 33 **************************************************************************/
32 char * 34 char *
33 rand_guid() 35 rand_guid()
148 150
149 /*encode the str to RFC2047 style 151 /*encode the str to RFC2047 style
150 * Currently only support the UTF-8 and base64 encode 152 * Currently only support the UTF-8 and base64 encode
151 */ 153 */
152 char * 154 char *
153 msn_encode_mime(char *str) 155 msn_encode_mime(const char *str)
154 { 156 {
155 char *base64; 157 char *base64;
156 158
157 base64 = gaim_base64_encode(str,strlen(str)); 159 base64 = gaim_base64_encode((guchar *)str, strlen(str));
158 return g_strdup_printf("=?utf-8?B?%s?=",base64); 160 return g_strdup_printf("=?utf-8?B?%s?=", base64);
159 } 161 }
160 162
161 /* 163 /*
162 * We need this because we're only supposed to encode spaces in the font 164 * We need this because we're only supposed to encode spaces in the font
163 * names. gaim_url_encode() isn't acceptable. 165 * names. gaim_url_encode() isn't acceptable.
547 # else 549 # else
548 # define __P(args) () 550 # define __P(args) ()
549 # endif /* GCC. */ 551 # endif /* GCC. */
550 #endif /* Not __P. */ 552 #endif /* Not __P. */
551 553
552 #if ! HAVE_LOCALTIME_R && ! defined localtime_r 554 #if defined(HAVE_LOCALTIME_R) && ! HAVE_LOCALTIME_R && ! defined localtime_r
553 # ifdef _LIBC 555 # ifdef _LIBC
554 # define localtime_r __localtime_r 556 # define localtime_r __localtime_r
555 # else 557 # else
556 /* Approximate localtime_r as best we can in its absence. */ 558 /* Approximate localtime_r as best we can in its absence. */
557 # define localtime_r my_localtime_r 559 # define localtime_r my_localtime_r