Try to avoid the use of 'z' modifier in cases where it is not
authorLuigi Rizzo <rizzo@icir.org>
Fri, 13 Oct 2006 11:18:01 +0000 (11:18 +0000)
committerLuigi Rizzo <rizzo@icir.org>
Fri, 13 Oct 2006 11:18:01 +0000 (11:18 +0000)
necessary - rather, cast the argument to int.

In this case, the string is in a UDP packet and as such
limited to 64k so its length can be safely represented in an int
without truncation (besides, this is just a debugging message!)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45010 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index f4de10b..44dc0c2 100644 (file)
@@ -4401,9 +4401,9 @@ static void parse_request(struct sip_request *req)
                else if (*c == '\n') { /* end of this line */
                        *c = '\0';
                        if (sipdebug && option_debug > 3)
-                               ast_log(LOG_DEBUG, "%7s %2d [%3zd]: %s\n",
+                               ast_log(LOG_DEBUG, "%7s %2d [%3d]: %s\n",
                                        req->headers < 0 ? "Header" : "Body",
-                                       i, strlen(dst[i]), dst[i]);
+                                       i, (int)strlen(dst[i]), dst[i]);
                        if (ast_strlen_zero(dst[i]) && req->headers < 0) {
                                req->headers = i;       /* record number of header lines */
                                dst = req->line;        /* start working on the body */