Browse Source

preset : Initialize selected device indices

Initialize the selected device sequence and item index so default-constructed
device selections contain defined index values before they are used. This
avoids undefined behavior from accessing uninitialized members.

Found by cppcheck (uninitMemberVar).

Signed-off-by: Robin Getz <rgetz503@gmail.com>
chirpmodem-v8.0.0
Robin Getz 2 months ago
parent
commit
4ae02698a9
No known key found for this signature in database
GPG Key ID: 51C7231FFED0E060
  1. 8
      sdrbase/settings/preset.h

8
sdrbase/settings/preset.h

@ -61,10 +61,10 @@ public: @@ -61,10 +61,10 @@ public:
struct SelectedDevice
{
QString m_deviceId;
QString m_deviceSerial;
int m_deviceSequence;
int m_deviceItemIndex;
QString m_deviceId;
QString m_deviceSerial;
int m_deviceSequence = 0;
int m_deviceItemIndex = 0;
SelectedDevice() = default;
SelectedDevice(const SelectedDevice&) = default;

Loading…
Cancel
Save