Skip to content

Commit 54b521f

Browse files
committed
Sonar fix
1 parent 89a15d4 commit 54b521f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

plugins/channelrx/demodft8/pskreporterworker.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,11 @@ void PskReporterWorker::processFT8Messages(const QList<FT8Message>& ft8Messages,
126126
txPtr +=1;
127127

128128
// Station Mode
129-
*(uint8_t *)&txInfoData[txPtr] = (uint8_t)strlen(txMode);
129+
const size_t modeLen = strlen(txMode);
130+
*(uint8_t *)&txInfoData[txPtr] = (uint8_t)modeLen;
130131
txPtr += 1;
131-
strncpy((char *)&txInfoData[txPtr], txMode, strlen(txMode));
132-
txPtr += strlen(txMode);
132+
memcpy(&txInfoData[txPtr], txMode, modeLen);
133+
txPtr += modeLen;
133134

134135
// Station locator
135136
*(uint8_t *)&txInfoData[txPtr] = (uint8_t) msg.loc.size();

0 commit comments

Comments
 (0)