]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix signedness issue and strlen to uint32_t cast
authorMichael Jerris <mike@jerris.com>
Sun, 13 Aug 2006 05:09:29 +0000 (05:09 +0000)
committerMichael Jerris <mike@jerris.com>
Sun, 13 Aug 2006 05:09:29 +0000 (05:09 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2280 d0543943-73ff-0310-b7d9-9358b9ac24b2

libs/libdingaling/src/libdingaling.c

index c1e0a0a681b40f3ffd6f769f6b47c4c8f2c242ee..9e8bb4762e871ee8f685d32426cfa5a54586e560 100644 (file)
@@ -592,7 +592,8 @@ static const char c64[65] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxy
 #define B64BUFFLEN 1024
 
 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;
 
        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, "encoding", "UTF-8");
                                                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));
                                                iks_insert_cdata(x, base64, 0);
                                                iks_send(handle->parser, x);