gcontini
2020-05-16 66e0472bc89ca49f362fadd02e2e14454eb220fe
src/library/base/base64.cpp
@@ -39,7 +39,7 @@
};  // This array has 255 elements
// review api
void add_CR_if_needed(string& encodeBuffer, int lineLenght) {
static void add_CR_if_needed(string& encodeBuffer, int lineLenght) {
   if (lineLenght > 0 && ((encodeBuffer.size() + 1) % lineLenght) == 0) {
      encodeBuffer += '\n';
   }
@@ -111,7 +111,7 @@
   int cb = 0;
   int charNo;
   int pad = 0;
   int len = tmp_str.size();
   size_t len = tmp_str.size();
   if (len < 2) {  // 2 accesses below would be OOB.
      // catch empty string, return NULL as result.
@@ -121,7 +121,7 @@
   if (safeAsciiPtr[len - 1] == '=') ++pad;
   if (safeAsciiPtr[len - 2] == '=') ++pad;
   unsigned int flen = 3 * len / 4 - pad;
   size_t flen = 3 * len / 4 - pad;
   bin.reserve(flen);
   for (charNo = 0; charNo <= len - 4 - pad; charNo += 4) {