Add missing initialization of curr

This commit is contained in:
Jason Rhinelander 2020-05-12 18:55:56 -03:00
parent e970f14e55
commit de395af872
2 changed files with 2 additions and 2 deletions

View File

@ -142,7 +142,7 @@ template <typename InputIt, typename OutputIt>
void from_base32z(InputIt begin, InputIt end, OutputIt out) {
using Char = decltype(*begin);
static_assert(sizeof(Char) == 1, "from_base32z requires chars/bytes");
uint_fast16_t curr;
uint_fast16_t curr = 0;
int bits = 0; // number of bits we've loaded into val; we always keep this < 8.
while (begin != end) {
curr = curr << 5 | detail::b32z_lut.from_b32z(*begin++);

View File

@ -171,7 +171,7 @@ template <typename InputIt, typename OutputIt>
void from_base64(InputIt begin, InputIt end, OutputIt out) {
using Char = decltype(*begin);
static_assert(sizeof(Char) == 1, "from_base64 requires chars/bytes");
uint_fast16_t curr;
uint_fast16_t curr = 0;
int bits = 0; // number of bits we've loaded into val; we always keep this < 8.
while (begin != end) {
Char c = *begin++;