dovecot-2.2: lib-http: Avoid compiler warnings in printf() strings.

dovecot at dovecot.org dovecot at dovecot.org
Sun Sep 27 17:48:51 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/7010dd10ccc6
changeset: 19224:7010dd10ccc6
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Sep 27 20:47:20 2015 +0300
description:
lib-http: Avoid compiler warnings in printf() strings.
Cast fields explicitly as long, which should be large enough.

diffstat:

 src/lib-http/http-server-connection.c |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (16 lines):

diff -r ca0916045005 -r 7010dd10ccc6 src/lib-http/http-server-connection.c
--- a/src/lib-http/http-server-connection.c	Sun Sep 27 20:46:29 2015 +0300
+++ b/src/lib-http/http-server-connection.c	Sun Sep 27 20:47:20 2015 +0300
@@ -806,10 +806,10 @@
 			if (net_getunixcred(fd_in, &cred) < 0) {
 				name = t_strdup_printf("[%u]", id);
 			} else if (cred.pid == (pid_t)-1) {
-				name = t_strdup_printf("unix:uid=%u [%u]", cred.uid, id);
+				name = t_strdup_printf("unix:uid=%ld [%u]", (long)cred.uid, id);
 			} else {
 				name = t_strdup_printf
-					("unix:pid=%u,uid=%u [%u]", cred.pid, cred.uid, id);
+					("unix:pid=%ld,uid=%ld [%u]", (long)cred.pid, (long)cred.uid, id);
 			}
 		} else if (addr.family == AF_INET6) {
 			name = t_strdup_printf("[%s]:%u [%u]", net_ip2addr(&addr), port, id);


More information about the dovecot-cvs mailing list