[asterisk-commits] russell: trunk r227464 - /trunk/res/res_pktccops.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 3 16:13:28 CST 2009


Author: russell
Date: Tue Nov  3 16:13:25 2009
New Revision: 227464

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=227464
Log:
Resolve another warning.

Modified:
    trunk/res/res_pktccops.c

Modified: trunk/res/res_pktccops.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_pktccops.c?view=diff&rev=227464&r1=227463&r2=227464
==============================================================================
--- trunk/res/res_pktccops.c (original)
+++ trunk/res/res_pktccops.c Tue Nov  3 16:13:25 2009
@@ -315,6 +315,7 @@
 	int len, lent;
 	char buf[COPS_HEADER_SIZE];
 	struct pktcobj *pobject = NULL;
+	uint16_t *ubuf = (uint16_t *) buf;
 	recmsg->msg = NULL;
 	recmsg->object = NULL;
 	len = recv(sfd, buf, COPS_HEADER_SIZE, MSG_DONTWAIT);
@@ -357,7 +358,7 @@
 				return lent;
 			}
 			len += lent;
-			pobject->length = ntohs(*((uint16_t *) buf));
+			pobject->length = ntohs(*ubuf);
 			pobject->cnum = *(buf + 2);
 			pobject->ctype = *(buf + 3);
 			if (!(pobject->contents = malloc(pobject->length - COPS_OBJECT_HEADER_SIZE))) {




More information about the asterisk-commits mailing list