coverity findings: initialize index counter in line splitter.
authorKim Kulling <kim.kulling@googlemail.com>
Wed, 30 Dec 2015 15:33:54 +0000 (16:33 +0100)
committerKim Kulling <kim.kulling@googlemail.com>
Wed, 30 Dec 2015 15:33:54 +0000 (16:33 +0100)
code/LineSplitter.h

index b517bd2..ea4a902 100644 (file)
@@ -83,7 +83,8 @@ public:
     note: trim is *always* assumed true if skyp_empty_lines==true
     */
     LineSplitter(StreamReaderLE& stream, bool skip_empty_lines = true, bool trim = true)
-        : stream(stream)
+        : idx( 0 )
+        , stream(stream)
         , swallow()
         , skip_empty_lines(skip_empty_lines)
         , trim(trim)
@@ -94,6 +95,10 @@ public:
         idx = 0;
     }
 
+    ~LineSplitter() {
+        // empty
+    }
+
 public:
 
     // -----------------------------------------
@@ -227,7 +232,10 @@ public:
     }
 
 private:
+    LineSplitter( const LineSplitter & );
+    LineSplitter &operator = ( const LineSplitter & );
 
+private:
     line_idx idx;
     std::string cur;
     StreamReaderLE& stream;