Mercurial > pidgin
comparison src/util.c @ 5532:6f35b80c5ffa
[gaim-migrate @ 5932]
(10:04:36) Robot101: LSchiere: alternative way to deal with the magic number - remove it. doesn't crash
when signing on to a HTTP proxy. also resolves the mysterious "unsigned tmp" which appeared a week or few
ago..
committer: Tailor Script <tailor@pidgin.im>
| author | Luke Schierer <lschiere@pidgin.im> |
|---|---|
| date | Mon, 26 May 2003 14:04:53 +0000 |
| parents | 10920646988f |
| children | 7a64114641c3 |
comparison
equal
deleted
inserted
replaced
| 5531:10920646988f | 5532:6f35b80c5ffa |
|---|---|
| 352 | 352 |
| 353 /* This was borrowed from the Kame source, and then tweaked to our needs */ | 353 /* This was borrowed from the Kame source, and then tweaked to our needs */ |
| 354 char *tobase64(const unsigned char *buf, size_t len) | 354 char *tobase64(const unsigned char *buf, size_t len) |
| 355 { | 355 { |
| 356 char *s = NULL, *rv = NULL; | 356 char *s = NULL, *rv = NULL; |
| 357 unsigned tmp; | 357 unsigned char tmp; |
| 358 | |
| 359 if(len == (size_t)(-1)) | |
| 360 len = strlen(buf); | |
| 361 | 358 |
| 362 s = g_malloc((4 * (len + 1)) / 3 + 1); | 359 s = g_malloc((4 * (len + 1)) / 3 + 1); |
| 363 | 360 |
| 364 rv = s; | 361 rv = s; |
| 365 while (len >= 3) { | 362 while (len >= 3) { |
