Skip to content

Commit ae4641f

Browse files
committed
Remove side effects from conditional in purr.
Based on SonarQube rule: c:S912.
1 parent cd14bff commit ae4641f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

purr.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,10 @@ int main (int argc, char **argv)
221221
}
222222

223223
// clean up hash property, if present
224-
char *hash_prop;
225-
if (!encrypt && (hash_prop = strchr(path, '#'))) {
226-
*hash_prop = 0;
224+
if (!encrypt) {
225+
char *hash_prop = strchr(path, '#');
226+
if (hash_prop)
227+
*hash_prop = 0;
227228
}
228229

229230
uint8_t *key = NULL;

0 commit comments

Comments
 (0)