Skip to content

Commit

Permalink
use operator= instead of memcpy
Browse files Browse the repository at this point in the history
  • Loading branch information
hemanth-silabs committed Oct 17, 2023
1 parent 1c9ac9c commit 519eca2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/spinel/radio_spinel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -902,9 +902,9 @@ otError RadioSpinel::SetMacKey(uint8_t aKeyIdMode,
#else
OT_UNUSED_VARIABLE(aKeySize);

memcpy(prevKey.m8, aPrevKey->mKeyMaterial.mKey.m8, OT_MAC_KEY_SIZE);
memcpy(currKey.m8, aCurrKey->mKeyMaterial.mKey.m8, OT_MAC_KEY_SIZE);
memcpy(nextKey.m8, aNextKey->mKeyMaterial.mKey.m8, OT_MAC_KEY_SIZE);
prevKey = aPrevKey->mKeyMaterial.mKey;
currKey = aCurrKey->mKeyMaterial.mKey;
nextKey = aNextKey->mKeyMaterial.mKey;
#endif

SuccessOrExit(error = Set(SPINEL_PROP_RCP_MAC_KEY,
Expand All @@ -917,9 +917,9 @@ otError RadioSpinel::SetMacKey(uint8_t aKeyIdMode,
mKeyIdMode = aKeyIdMode;
mKeyId = aKeyId;

memcpy(mPrevKey.m8, prevKey.m8, OT_MAC_KEY_SIZE);
memcpy(mCurrKey.m8, currKey.m8, OT_MAC_KEY_SIZE);
memcpy(mNextKey.m8, nextKey.m8, OT_MAC_KEY_SIZE);
mPrevKey = prevKey;
mCurrKey = currKey;
mNextKey = nextKey;

mMacKeySet = true;
#endif
Expand Down

0 comments on commit 519eca2

Please sign in to comment.