[asterisk-commits] rizzo: trunk r51310 - /trunk/main/rtp.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 19 10:48:49 MST 2007


Author: rizzo
Date: Fri Jan 19 11:48:48 2007
New Revision: 51310

URL: http://svn.digium.com/view/asterisk?view=rev&rev=51310
Log:
in the interest of portability, avoid using %zd when all
we need is to print is an integer that fits in 16 bits.


Modified:
    trunk/main/rtp.c

Modified: trunk/main/rtp.c
URL: http://svn.digium.com/view/asterisk/trunk/main/rtp.c?view=diff&rev=51310&r1=51309&r2=51310
==============================================================================
--- trunk/main/rtp.c (original)
+++ trunk/main/rtp.c Fri Jan 19 11:48:48 2007
@@ -431,14 +431,14 @@
 	
 	if (len < sizeof(struct stun_header)) {
 		if (option_debug)
-			ast_log(LOG_DEBUG, "Runt STUN packet (only %zd, wanting at least %zd)\n", len, sizeof(struct stun_header));
+			ast_log(LOG_DEBUG, "Runt STUN packet (only %d, wanting at least %d)\n", (int) len, sizeof(struct stun_header));
 		return -1;
 	}
 	if (stundebug)
 		ast_verbose("STUN Packet, msg %s (%04x), length: %d\n", stun_msg2str(ntohs(hdr->msgtype)), ntohs(hdr->msgtype), ntohs(hdr->msglen));
 	if (ntohs(hdr->msglen) > len - sizeof(struct stun_header)) {
 		if (option_debug)
-			ast_log(LOG_DEBUG, "Scrambled STUN packet length (got %d, expecting %zd)\n", ntohs(hdr->msglen), len - sizeof(struct stun_header));
+			ast_log(LOG_DEBUG, "Scrambled STUN packet length (got %d, expecting %d)\n", ntohs(hdr->msglen), (int)(len - sizeof(struct stun_header)));
 	} else
 		len = ntohs(hdr->msglen);
 	data += sizeof(struct stun_header);
@@ -446,13 +446,13 @@
 	while(len) {
 		if (len < sizeof(struct stun_attr)) {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Runt Attribute (got %zd, expecting %zd)\n", len, sizeof(struct stun_attr));
+				ast_log(LOG_DEBUG, "Runt Attribute (got %d, expecting %d)\n", (int)len, sizeof(struct stun_attr));
 			break;
 		}
 		attr = (struct stun_attr *)data;
 		if (ntohs(attr->len) > len) {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Inconsistent Attribute (length %d exceeds remaining msg len %zd)\n", ntohs(attr->len), len);
+				ast_log(LOG_DEBUG, "Inconsistent Attribute (length %d exceeds remaining msg len %d)\n", ntohs(attr->len), (int)len);
 			break;
 		}
 		if (stun_process_attr(&st, attr)) {



More information about the asterisk-commits mailing list