mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-02 16:22:40 -06:00
uppsrc: Undefined Behaviour sanitization
git-svn-id: svn://ultimatepp.org/upp/trunk@13032 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
6f9358dbb4
commit
7ab13ffc80
18 changed files with 65 additions and 64 deletions
|
|
@ -235,12 +235,14 @@ String QPDecode(const char *s, bool underscore_to_space)
|
|||
return r;
|
||||
}
|
||||
|
||||
String Base64Encode(const char *b, const char *e)
|
||||
String Base64Encode(const char *_b, const char *_e)
|
||||
{
|
||||
static const char encoder[] =
|
||||
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
"abcdefghijklmnopqrstuvwxyz"
|
||||
"0123456789+/";
|
||||
const byte *b = (byte *)_b; // avoid left shift of negative value sanitizer issue
|
||||
const byte *e = (byte *)_e;
|
||||
if(b == e)
|
||||
return Null;
|
||||
int out = (int(e - b) + 2) / 3 * 4;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue