Fix misplaced parentheses in error code comparison 24/245224/1
authorMateusz Cegielka <m.cegielka@samsung.com>
Mon, 5 Oct 2020 15:18:13 +0000 (17:18 +0200)
committerMateusz Cegielka <m.cegielka@samsung.com>
Mon, 5 Oct 2020 15:23:39 +0000 (17:23 +0200)
Some newer SVACE version I happened to run locally detected misplaced
parentheses here. Fortunately, this would only result in returning a
wrong error code and not ignoring the error.

I have fixed the mistake, also removing the use of an assignment in an
if statement because there is no reason to do so.

Change-Id: I441e882ffbd484b6a7ec47eeaf5999b5e7992cd7

src/manager/client-capi/ckmc-manager.cpp

index 86cc153..febac67 100644 (file)
@@ -241,12 +241,9 @@ int _toNewCkmcAliasInfoList(const CKM::AliasPwdVector &aliasPwdVector,
                if (previous != nullptr)
                        previous->next = plist;
 
-               if ((ret = _ckmc_alias_info_new(std::get<0>(it).c_str(), std::get<1>(it),
-                                               &plist->info) != CKMC_ERROR_NONE))
-               {
+               ret = _ckmc_alias_info_new(std::get<0>(it).c_str(), std::get<1>(it), &plist->info);
+               if (ret != CKMC_ERROR_NONE)
                        break;
-               }
-
        }
 
        if (ret != CKMC_ERROR_NONE)