diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-12-07 19:21:34 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-12-07 22:15:06 +0100 |
commit | c4d3d5a753adc005c34aee3f7f81df4c36d3e261 (patch) | |
tree | b7f3ac92c0e8973fdd514d08e262a9d62e131a81 /svtools/source/svrtf | |
parent | ec1795c654cc7a1ae7f7eed0db0588e206346c11 (diff) |
clang-tidy(WIP): bugprone-signed-char-misuse findings 3
Convert char to unsigned char first in some found use cases.
In these cases the chart is converted to an unsigned integer,
so characters with negativ values would be converted to wierd
values around the maximum value of sal_uInt32.
Change-Id: I5570b414ff9c0178222ec40830b490824d8abb07
Reviewed-on: https://gerrit.libreoffice.org/84690
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'svtools/source/svrtf')
-rw-r--r-- | svtools/source/svrtf/parrtf.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/svtools/source/svrtf/parrtf.cxx b/svtools/source/svrtf/parrtf.cxx index c3a43bf8a34d..8a83512c06ae 100644 --- a/svtools/source/svrtf/parrtf.cxx +++ b/svtools/source/svrtf/parrtf.cxx @@ -386,7 +386,7 @@ void SvRTFParser::ScanText() if (nSlash != '\\' || nNextCh != '\'') { rInput.SeekRel(-1); - nNextCh = nSlash; + nNextCh = static_cast<unsigned char>(nSlash); break; } } @@ -582,7 +582,8 @@ SvParserState SvRTFParser::CallParser() { sal_Char cFirstCh; nNextChPos = rInput.Tell(); - rInput.ReadChar( cFirstCh ); nNextCh = cFirstCh; + rInput.ReadChar( cFirstCh ); + nNextCh = static_cast<unsigned char>(cFirstCh); eState = SvParserState::Working; nOpenBrakets = 0; eCodeSet = RTL_TEXTENCODING_MS_1252; |