mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-28 03:40:04 +00:00
Handle empty strings.
This commit is contained in:
parent
1f658209f8
commit
873b3b4800
6
extern/Base64/Base64.h
vendored
6
extern/Base64/Base64.h
vendored
@ -95,6 +95,12 @@ class Base64 {
|
||||
size_t in_len = input.size();
|
||||
if (in_len % 4 != 0) return "Input data size is not a multiple of 4";
|
||||
|
||||
if (in_len == 0)
|
||||
{
|
||||
out = "";
|
||||
return "";
|
||||
}
|
||||
|
||||
size_t out_len = in_len / 4 * 3;
|
||||
if (input[in_len - 1] == '=') out_len--;
|
||||
if (input[in_len - 2] == '=') out_len--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user