fix base64 decoding on ARM

Review Request #128295 - Created June 27, 2016 and submitted

Information
Rolf Eike Beer
qca
master
364495
Reviewers
kdeframeworks

This code was broken on ARM and other architectures where "char" is unsigned by default.

First, it breaks with newer compilers with errors like:

.../src/qca_textfilter.cpp:314:2: error: narrowing conversion of '-1' from 'int' to 'char' inside { } [-Wnarrowing]

Second, if the compiler would just allow this conversion then the unsigned char would hold 255, which would not be sign extended when cast to an int later, so all the checks "< 0" will never trigger, and so invalid input characters cannot be detected.

Builds without error on newer gcc now.

Milian Wolff
Rolf Eike Beer
Review request changed

Status: Closed (submitted)

Change Summary:

Submitted with commit 601fd3a05141c614ae48a3ddac44194d669eaae1 by Rolf Eike Beer to branch master.
Loading...