kimgio: minor raw plugin review

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-26 07:55:38 +03:00
parent b8834c9cdd
commit e400b6841e

View file

@ -116,17 +116,17 @@ INT64 RAWDataStream::size()
int RAWDataStream::get_char() int RAWDataStream::get_char()
{ {
char ch = 0; char result = 0;
if (!m_device->getChar(&ch)) { if (!m_device->getChar(&result)) {
return -1; return -1;
} }
return static_cast<uchar>(ch); return static_cast<uchar>(result);
} }
char* RAWDataStream::gets(char* rawbuffer, int rawsize) char* RAWDataStream::gets(char* rawbuffer, int rawsize)
{ {
const qint64 readresult = m_device->readLine(rawbuffer, rawsize); const qint64 result = m_device->readLine(rawbuffer, rawsize);
if (readresult > 0) { if (result > 0) {
return rawbuffer; return rawbuffer;
} }
return nullptr; return nullptr;