From ae4641fcd455e0f6d1cb0ab716273b7cb0295646 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira?= Date: Mon, 13 Jan 2025 16:11:06 -0300 Subject: [PATCH] Remove side effects from conditional in purr. Based on SonarQube rule: c:S912. --- purr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/purr.c b/purr.c index f38fc61..4b9919f 100644 --- a/purr.c +++ b/purr.c @@ -221,9 +221,10 @@ int main (int argc, char **argv) } // clean up hash property, if present - char *hash_prop; - if (!encrypt && (hash_prop = strchr(path, '#'))) { - *hash_prop = 0; + if (!encrypt) { + char *hash_prop = strchr(path, '#'); + if (hash_prop) + *hash_prop = 0; } uint8_t *key = NULL;