]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Avoid compiler warnings in printf() strings.
authorTimo Sirainen <tss@iki.fi>
Sun, 27 Sep 2015 17:47:20 +0000 (20:47 +0300)
committerTimo Sirainen <tss@iki.fi>
Sun, 27 Sep 2015 17:47:20 +0000 (20:47 +0300)
Cast fields explicitly as long, which should be large enough.

src/lib-http/http-server-connection.c

index 86ef0d818cfb215f4d182c0a2094218ec4b0daa4..c42db8188a3e74298b3cc12c132d12f6f85c569c 100644 (file)
@@ -806,10 +806,10 @@ http_server_connection_create(struct http_server *server,
                        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);