]> Dogcows Code - chaz/vimcoder/commitdiff
fix infinite loop bug when reading test cases
authorSam Lidder <sam.lidder@gmail.com>
Sat, 18 Aug 2012 05:39:59 +0000 (01:39 -0400)
committerSam Lidder <sam.lidder@gmail.com>
Sat, 18 Aug 2012 22:01:51 +0000 (18:01 -0400)
- pushing character back onto stream causes stream state to never fail
  when test cases contain string and/or vector<string> for
  paramater/return values
- simplest case found so far: parameter: string, return: string

src/com/dogcows/resources/C++Driver

index 9ca857968510527b6388536028a3a67e6dbf0a2d..60ef873967713dd8bd18ec8331aa3f24df74c6cc 100644 (file)
@@ -67,10 +67,6 @@ std::istream& operator >> (std::istream& in, std::string& str)
                }
                str = s.str();
        }
-       else
-       {
-               in.putback(c);
-       }
 
        return in;
 }
@@ -94,10 +90,6 @@ std::istream& operator >> (std::istream& in, std::vector<T>& vec)
                        while (in.good() && std::isspace(in.peek())) in.get();
                }
        }
-       else
-       {
-               in.putback(c);
-       }
 
        return in;
 }
This page took 0.024648 seconds and 4 git commands to generate.