diff options
author | David Robillard <d@drobilla.net> | 2018-12-31 11:54:26 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2019-01-05 17:12:38 +0100 |
commit | 9b80535334de1a3ca0bf40d2f1109202385148aa (patch) | |
tree | 34e5a1f011e1f10d1797b364ce760f92f795df9f | |
parent | e7f88b4e0e3a88ff79a956b67590cb2b0c4fd16b (diff) | |
download | serd-9b80535334de1a3ca0bf40d2f1109202385148aa.tar.gz serd-9b80535334de1a3ca0bf40d2f1109202385148aa.tar.bz2 serd-9b80535334de1a3ca0bf40d2f1109202385148aa.zip |
Fix implicit signed conversions in base64 implementation
-rw-r--r-- | src/base64.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/base64.c b/src/base64.c index 7bc4a127..4171ed22 100644 --- a/src/base64.c +++ b/src/base64.c @@ -38,7 +38,7 @@ static const uint8_t b64_map[] = for decoding, shifted up by 47 to be in the range of printable ASCII. A '$' is a placeholder for characters not in the base64 alphabet. */ -static const char b64_unmap[] = +static const uint8_t b64_unmap[] = "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$m$$$ncdefghijkl$$$$$$" "$/0123456789:;<=>?@ABCDEFGH$$$$$$IJKLMNOPQRSTUVWXYZ[\\]^_`ab$$$$" "$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$" @@ -113,7 +113,7 @@ serd_base64_decode(const char* str, size_t len, size_t* size) uint8_t in[] = "===="; size_t n_in = 0; for (; i < len && n_in < 4; ++n_in) { - for (; i < len && !is_base64(ustr[i]); ++i) {} // Skip junk + for (; i < len && !is_base64(str[i]); ++i) {} // Skip junk in[n_in] = ustr[i++]; } if (n_in > 1) { |