mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-03-13 20:50:41 +00:00
fix signedness issue and strlen to uint32_t cast
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2280 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
c0be28d911
commit
d066dca08e
@ -592,7 +592,8 @@ static const char c64[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy
|
|||||||
#define B64BUFFLEN 1024
|
#define B64BUFFLEN 1024
|
||||||
|
|
||||||
static int b64encode(unsigned char *in, uint32_t ilen, unsigned char *out, uint32_t olen) {
|
static int b64encode(unsigned char *in, uint32_t ilen, unsigned char *out, uint32_t olen) {
|
||||||
int x=0,y=0,bytes=0;
|
int y=0,bytes=0;
|
||||||
|
uint32_t x=0;
|
||||||
unsigned int b=0,l=0;
|
unsigned int b=0,l=0;
|
||||||
|
|
||||||
for(x=0;x<ilen;x++) {
|
for(x=0;x<ilen;x++) {
|
||||||
@ -667,7 +668,7 @@ static int on_stream(ldl_handle_t *handle, int type, iks * node)
|
|||||||
iks_insert_attrib(x, "mechanism", "PLAIN");
|
iks_insert_attrib(x, "mechanism", "PLAIN");
|
||||||
iks_insert_attrib(x, "encoding", "UTF-8");
|
iks_insert_attrib(x, "encoding", "UTF-8");
|
||||||
snprintf(s, sizeof(s), "%c%s%c%s", 0, handle->acc->user, 0, handle->password);
|
snprintf(s, sizeof(s), "%c%s%c%s", 0, handle->acc->user, 0, handle->password);
|
||||||
slen = strlen(handle->acc->user) + strlen(handle->password) + 2;
|
slen = (uint32_t)(strlen(handle->acc->user) + strlen(handle->password) + 2);
|
||||||
b64encode((unsigned char *)s, slen, (unsigned char *) base64, sizeof(base64));
|
b64encode((unsigned char *)s, slen, (unsigned char *) base64, sizeof(base64));
|
||||||
iks_insert_cdata(x, base64, 0);
|
iks_insert_cdata(x, base64, 0);
|
||||||
iks_send(handle->parser, x);
|
iks_send(handle->parser, x);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user