[4.0] bba689d Truncate %D varnishncsa format specifier to an integer value.

Martin Blix Grydeland martin at varnish-software.com
Tue Jun 24 11:31:48 CEST 2014


commit bba689d2fa11223f765ac773d36fd7e0b7c63dc3
Author: Martin Blix Grydeland <martin at varnish-software.com>
Date:   Fri May 16 14:23:28 2014 +0200

    Truncate %D varnishncsa format specifier to an integer value.
    
    This follows the format Apache logs in.

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index e3f2432..2162118 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -276,7 +276,7 @@ format_time(const struct format *format)
 
 	switch (format->time_type) {
 	case 'D':
-		AZ(VSB_printf(CTX.vsb, "%f", (t_end - t_start) * 1e6));
+		AZ(VSB_printf(CTX.vsb, "%d", (int)((t_end - t_start) * 1e6)));
 		break;
 	case 't':
 		AN(format->time_fmt);



More information about the varnish-commit mailing list