diff options
author | Olivier Fourdan <ofourdan@redhat.com> | 2019-04-11 09:05:15 +0200 |
---|---|---|
committer | Olivier Fourdan <ofourdan@redhat.com> | 2019-04-11 09:38:00 +0200 |
commit | b6aad584c1dc278364c295165512b5f5b98c173e (patch) | |
tree | d734dbad33d1c99a32ea623cc25e93664ecc8cb7 /src | |
parent | 772e5b0fdfc9dbd8bec070bd0c4c7eb5565df2ee (diff) |
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 <ofourdan@redhat.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/process.c | 6 |
1 files 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); |