From b6aad584c1dc278364c295165512b5f5b98c173e Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Thu, 11 Apr 2019 09:05:15 +0200 Subject: cleanup: Separate variable assignment and test Assigning and testing a value in a single statement hinders code clarity and may confuses static code analyzers. Separate the assignment and the test for clarity. Signed-off-by: Olivier Fourdan --- src/process.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/process.c b/src/process.c index fae081b..89ebbea 100644 --- a/src/process.c +++ b/src/process.c @@ -930,7 +930,8 @@ ProcessConnectionSetup ( EXTRACT_STRING (pData, swap, vendor); EXTRACT_STRING (pData, swap, release); - if ((hisAuthCount = message->authCount) > 0) + hisAuthCount = message->authCount; + if (hisAuthCount > 0) { hisAuthNames = malloc (hisAuthCount * sizeof (char *)); EXTRACT_LISTOF_STRING (pData, swap, hisAuthCount, hisAuthNames); @@ -1968,7 +1969,8 @@ ProcessProtocolSetup ( EXTRACT_STRING (pData, swap, vendor); EXTRACT_STRING (pData, swap, release); - if ((hisAuthCount = message->authCount) > 0) + hisAuthCount = message->authCount; + if (hisAuthCount > 0) { hisAuthNames = malloc (hisAuthCount * sizeof (char *)); EXTRACT_LISTOF_STRING (pData, swap, hisAuthCount, hisAuthNames); -- cgit v1.2.3