瀏覽代碼

FIReader: Silence uninitialized variable warning

This is a false positive. First time through the loop 'imod3' is always 0
so c1 is not used. It's also set so further iterations have a valid 'c1'.
If 'value' is empty the switch doesn't look at 'c1' either since 'imod3'
is still 0.
Turo Lamminen 8 年之前
父節點
當前提交
4652be8f18
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      code/FIReader.cpp

+ 1 - 1
code/FIReader.cpp

@@ -168,7 +168,7 @@ struct FIBase64ValueImpl: public FIBase64Value {
         if (!strValueValid) {
         if (!strValueValid) {
             strValueValid = true;
             strValueValid = true;
             std::ostringstream os;
             std::ostringstream os;
-            uint8_t c1, c2;
+            uint8_t c1 = 0, c2;
             int imod3 = 0;
             int imod3 = 0;
             std::vector<uint8_t>::size_type valueSize = value.size();
             std::vector<uint8_t>::size_type valueSize = value.size();
             for (std::vector<uint8_t>::size_type i = 0; i < valueSize; ++i) {
             for (std::vector<uint8_t>::size_type i = 0; i < valueSize; ++i) {