[master] d6aef69a6 vtest: Polish option code

Nils Goroll nils.goroll at uplex.de
Tue May 28 09:04:04 UTC 2024


commit d6aef69a6b1da8fc8e392d2de159a0861418d7ce
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue May 28 11:02:54 2024 +0200

    vtest: Polish option code
    
    Code after vtc_fatal() is unreachable

diff --git a/bin/varnishtest/vtc_misc.c b/bin/varnishtest/vtc_misc.c
index 52ec902b3..686fd191e 100644
--- a/bin/varnishtest/vtc_misc.c
+++ b/bin/varnishtest/vtc_misc.c
@@ -667,20 +667,16 @@ set_timeout(struct vtclog *vl, const char *val)
 	double num;
 	char *s = NULL;
 
-	if (val == NULL || *val == '\0') {
+	if (val == NULL || *val == '\0')
 		vtc_fatal(vl, "FAIL test, missing \"option timeout\" value");
-		return;
-	}
 	if (*val == 'x') {
 		num = strtod(val + 1, &s);
 		num *= vtc_maxdur;
 	} else
 		num = VNUM_duration(val);
 
-	if (isnan(num) || (s != NULL && *s != '\0')) {
+	if (isnan(num) || (s != NULL && *s != '\0'))
 		vtc_fatal(vl, "FAIL test, invalid \"option timeout\": %s", val);
-		return;
-	}
 	vtc_maxdur = num;
 	vtc_log(vl, 4, "new timeout %.2f", vtc_maxdur);
 }


More information about the varnish-commit mailing list