[master] 0cddee5ed Use sufficiently wide type.

Poul-Henning Kamp phk at FreeBSD.org
Tue Jun 18 05:43:10 UTC 2019


commit 0cddee5ed8a26a2ab09b672793c27d3f760b49c2
Author: Poul-Henning Kamp <phk at FreeBSD.org>
Date:   Tue Jun 18 05:36:35 2019 +0000

    Use sufficiently wide type.
    
    Spotted by:     fgs & ubsan

diff --git a/bin/varnishd/cache/cache_shmlog.c b/bin/varnishd/cache/cache_shmlog.c
index 836b53966..f3765ff70 100644
--- a/bin/varnishd/cache/cache_shmlog.c
+++ b/bin/varnishd/cache/cache_shmlog.c
@@ -371,8 +371,8 @@ VSLb(struct vsl_log *vsl, enum VSL_tag_e tag, const char *fmt, ...)
 	va_end(ap);
 }
 
-#define Tf6 "%ju.%06u"
-#define Ta6(t) (uintmax_t)floor((t)), (uint32_t)floor((t) * 1e6) % 1000000U
+#define Tf6 "%ju.%06ju"
+#define Ta6(t) (uintmax_t)floor((t)), (uintmax_t)floor((t) * 1e6) % 1000000U
 
 void
 VSLb_ts(struct vsl_log *vsl, const char *event, vtim_real first,


More information about the varnish-commit mailing list