Bug #23685
Unitialized variable codec
Start date:
12/02/2019
Due date:
% Done:
100%
Estimated time:
Occurs In:
Co-Assignees:
Description
Running cppcheck, a static code checker, there are three issues related to uninitialised variables.
Checking db_dialog.cpp ... db_dialog.cpp:32:16: error: Uninitialized variable: codec [uninitvar] daq_string = codec->codecForMib(106)->toUnicode(byte_status).split("\n", QString::KeepEmptyParts); ^ 2/5 files checked 25% done Checking main.cpp ... 3/5 files checked 25% done Checking mainwindow.cpp ... mainwindow.cpp:138:28: error: Uninitialized variable: codec [uninitvar] QStringList daq_string = codec->codecForMib(106)->toUnicode(byte_status).split("'", QString::KeepEmptyParts); ^ mainwindow.cpp:476:16: error: Uninitialized variable: codec [uninitvar] daq_string = codec->codecForMib(106)->toUnicode(daq_byte_array); ^
We need to find the right value to initialise them with.
As a reference for possible values see:
https://doc.qt.io/qt-5/qtextcodec.html
Related issues
History
#1 Updated by Iker de Icaza Astiz about 1 year ago
- Blocks Milestone #22444: v0_01_00: Plug and Play added
#2 Updated by Iker de Icaza Astiz about 1 year ago
- Assignee set to Iker de Icaza Astiz
#3 Updated by Iker de Icaza Astiz about 1 year ago
- % Done changed from 0 to 100
- Status changed from New to Resolved
Commit 57e90e7f91d573 solves this. Note that Mib 106 is UTF-8.
All cppchecks passing.
#4 Updated by Iker de Icaza Astiz about 1 year ago
- Status changed from Resolved to Closed