[master] 10c606d37 Trivial refactor of the debug stevedore
Nils Goroll
nils.goroll at uplex.de
Fri Jun 16 13:10:12 UTC 2023
commit 10c606d3759e106b5786f106454350b57b9daa1a
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Fri Jun 16 12:54:24 2023 +0200
Trivial refactor of the debug stevedore
diff --git a/bin/varnishd/storage/storage_debug.c b/bin/varnishd/storage/storage_debug.c
index 9a3360a42..dd3eee140 100644
--- a/bin/varnishd/storage/storage_debug.c
+++ b/bin/varnishd/storage/storage_debug.c
@@ -58,6 +58,7 @@ smd_init(struct stevedore *parent, int aac, char * const *aav)
const char *ident;
int i, ac = 0;
size_t nac;
+ char *a;
char **av; //lint -e429
ident = parent->ident;
@@ -76,11 +77,14 @@ smd_init(struct stevedore *parent, int aac, char * const *aav)
av = calloc(nac, sizeof *av);
AN(av);
for (i = 0; i < aac; i++) {
- if (aav[i] != NULL && ! strcmp(aav[i], "lessspace")) {
- methods->objgetspace = smd_lsp_getspace;
- continue;
+ a = aav[i];
+ if (a != NULL) {
+ if (! strcmp(a, "lessspace")) {
+ methods->objgetspace = smd_lsp_getspace;
+ continue;
+ }
}
- av[ac] = aav[i];
+ av[ac] = a;
ac++;
}
assert(ac >= 0);
More information about the varnish-commit
mailing list