Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
PIM
KItinerary
Commits
6ba77c36
Commit
6ba77c36
authored
May 14, 2021
by
Volker Krause
Browse files
Silence warning messages on 0-length RCT2 field reads
0-length fields make no sense, but are nevertheless common in ÖBB tickets.
parent
6fda5783
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/uic9183/uic9183utils.cpp
View file @
6ba77c36
...
@@ -37,6 +37,10 @@ int Uic9183Utils::readAsciiEncodedNumber(const Uic9183Block &block, int offset,
...
@@ -37,6 +37,10 @@ int Uic9183Utils::readAsciiEncodedNumber(const Uic9183Block &block, int offset,
QString
Uic9183Utils
::
readUtf8String
(
const
char
*
data
,
int
size
,
int
offset
,
int
length
)
QString
Uic9183Utils
::
readUtf8String
(
const
char
*
data
,
int
size
,
int
offset
,
int
length
)
{
{
if
(
length
==
0
)
{
// common in ÖBB RCT2 blocks...
return
{};
}
if
(
!
data
||
offset
<
0
||
length
<
1
||
size
<
1
||
offset
+
length
>
size
)
{
if
(
!
data
||
offset
<
0
||
length
<
1
||
size
<
1
||
offset
+
length
>
size
)
{
qCWarning
(
Log
)
<<
"Invalid UIC 918.3 read"
<<
offset
<<
length
<<
size
;
qCWarning
(
Log
)
<<
"Invalid UIC 918.3 read"
<<
offset
<<
length
<<
size
;
return
{};
return
{};
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment