[master] cbc7c8a32 varnishncsa: Minor polish after merge

Nils Goroll nils.goroll at uplex.de
Tue Apr 27 07:39:05 UTC 2021


commit cbc7c8a32f5f397a8fcb4f685ebdb8c44e25c759
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue Apr 27 09:36:06 2021 +0200

    varnishncsa: Minor polish after merge
    
    Why is it that a git push triggers a fresh look at the code?
    
    Ref #3602

diff --git a/bin/varnishncsa/varnishncsa.c b/bin/varnishncsa/varnishncsa.c
index 32a6943dc..75f788b00 100644
--- a/bin/varnishncsa/varnishncsa.c
+++ b/bin/varnishncsa/varnishncsa.c
@@ -287,9 +287,10 @@ format_time(const struct format *format)
 	} else
 		t_end = t_start;
 
+	AN(format->time_fmt);
+
 	switch (format->time_type) {
 	case 't':
-		AN(format->time_fmt);
 		t = (long)floor(t_start);
 		(void)localtime_r(&t, &tm);
 		AN(strftime(buf, sizeof buf, format->time_fmt, &tm));
@@ -323,7 +324,6 @@ format_time(const struct format *format)
 		WRONG("Time format specifier");
 	}
 
-	AN(format->time_fmt);
 	AZ(VSB_printf(CTX.vsb, format->time_fmt, l));
 
 	return (1);
@@ -462,7 +462,6 @@ addf_time(char type, const char *fmt)
 	f->func = format_time;
 	f->time_type = type;
 	f->time_fmt = strdup(fmt);
-	AN(f->time_fmt);
 
 	if (f->time_type == 'T') {
 		if (!strcmp(fmt, "s"))
@@ -500,6 +499,7 @@ addf_time(char type, const char *fmt)
 		}
 	}
 
+	AN(f->time_fmt);
 	VTAILQ_INSERT_TAIL(&CTX.format, f, list);
 }
 


More information about the varnish-commit mailing list