# HG changeset patch # User Luke Schierer # Date 1053957893 0 # Node ID 6f35b80c5ffa90009f644afae2e5c140da5f9d11 # Parent 10920646988f0e53f0b5194cc91d4857d676d5d5 [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 diff -r 10920646988f -r 6f35b80c5ffa src/proxy.c --- a/src/proxy.c Mon May 26 12:45:05 2003 +0000 +++ b/src/proxy.c Mon May 26 14:04:53 2003 +0000 @@ -785,7 +785,7 @@ if (phb->gpi->proxyuser) { char *t1, *t2; t1 = g_strdup_printf("%s:%s", phb->gpi->proxyuser, phb->gpi->proxypass); - t2 = tobase64(t1, -1); + t2 = tobase64(t1, strlen(t1)); g_free(t1); g_return_if_fail(request_len < sizeof(request)); request_len += g_snprintf(request + request_len, sizeof(request) - request_len, "Proxy-Authorization: Basic %s\r\n", t2); diff -r 10920646988f -r 6f35b80c5ffa src/util.c --- a/src/util.c Mon May 26 12:45:05 2003 +0000 +++ b/src/util.c Mon May 26 14:04:53 2003 +0000 @@ -354,10 +354,7 @@ char *tobase64(const unsigned char *buf, size_t len) { char *s = NULL, *rv = NULL; - unsigned tmp; - - if(len == (size_t)(-1)) - len = strlen(buf); + unsigned char tmp; s = g_malloc((4 * (len + 1)) / 3 + 1); diff -r 10920646988f -r 6f35b80c5ffa src/util.h --- a/src/util.h Mon May 26 12:45:05 2003 +0000 +++ b/src/util.h Mon May 26 14:04:53 2003 +0000 @@ -44,7 +44,7 @@ * Converts a string to its base-64 equivalent. * * @param buf The data to convert. - * @param len The length of the data, or -1 if it's a NULL-terminated string. + * @param len The length of the data. * * @return The base-64 version of @a str. *