From 4b1c8964ca5d1e769b69064f76e99c7b72c5002d Mon Sep 17 00:00:00 2001 From: rilysh Date: Tue, 1 Oct 2024 22:09:06 +0530 Subject: [PATCH] zdb.c: move strlen() before the for loop Signed-off-by: rilysh --- cmd/zdb/zdb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmd/zdb/zdb.c b/cmd/zdb/zdb.c index 6c2865cdb32..033947a898c 100644 --- a/cmd/zdb/zdb.c +++ b/cmd/zdb/zdb.c @@ -8816,7 +8816,8 @@ zdb_read_block(char *thing, spa_t *spa) for (s = strtok_r(flagstr, ":", &tmp); s != NULL; s = strtok_r(NULL, ":", &tmp)) { - for (i = 0, len = strlen(flagstr); i < len; i++) { + len = strlen(flagstr); + for (i = 0; i < len; i++) { int bit = flagbits[(uchar_t)flagstr[i]]; if (bit == 0) {