QGbkCodec: Initialize buf arrays
Fix developer build with GCC 7, which complains: codecs\qgb18030codec.cpp:387:37: error: 'buf[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs\qgb18030codec.cpp:8908:17: error: 'buf[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs\qgb18030codec.cpp:536:37: error: 'buf[1]' may be used uninitialized in this function [-Werror=maybe-uninitialized] codecs\qgb18030codec.cpp:535:37: error: 'buf[0]' may be used uninitialized in this function [-Werror=maybe-uninitialized] Change-Id: I7e98355c625276c74792707f22d4318c0cc9be6a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>bb10
parent
5a60934aa7
commit
f0b51dd0ee
|
|
@ -317,7 +317,7 @@ QList<QByteArray> QGbkCodec::_aliases()
|
|||
|
||||
QString QGbkCodec::convertToUnicode(const char* chars, int len, ConverterState *state) const
|
||||
{
|
||||
uchar buf[2];
|
||||
uchar buf[2] = {0, 0};
|
||||
int nbuf = 0;
|
||||
ushort replacement = QChar::ReplacementCharacter;
|
||||
if (state) {
|
||||
|
|
@ -467,7 +467,7 @@ QByteArray QGb2312Codec::_name()
|
|||
|
||||
QString QGb2312Codec::convertToUnicode(const char* chars, int len, ConverterState *state) const
|
||||
{
|
||||
uchar buf[2];
|
||||
uchar buf[2] = {0, 0};
|
||||
int nbuf = 0;
|
||||
ushort replacement = QChar::ReplacementCharacter;
|
||||
if (state) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue