[Freeswitch-svn] [commit] r2280 - freeswitch/trunk/libs/libdingaling/src

Freeswitch SVN mikej at freeswitch.org
Sun Aug 13 01:09:29 EDT 2006


Author: mikej
Date: Sun Aug 13 01:09:29 2006
New Revision: 2280

Modified:
   freeswitch/trunk/libs/libdingaling/src/libdingaling.c

Log:
fix signedness issue and strlen to uint32_t cast

Modified: freeswitch/trunk/libs/libdingaling/src/libdingaling.c
==============================================================================
--- freeswitch/trunk/libs/libdingaling/src/libdingaling.c	(original)
+++ freeswitch/trunk/libs/libdingaling/src/libdingaling.c	Sun Aug 13 01:09:29 2006
@@ -592,7 +592,8 @@
 #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 @@
 						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);



More information about the Freeswitch-svn mailing list