FCgiIO.cpp bug

Craig Anderson <[email protected]> Fri, 26 Apr 2002 07:05:18 -0700 (PDT)
Newsgroups gmane.comp.gcc.cgicc.bugs
Message-ID <[email protected]>
Hello and thanks for making a great class library.

I believe I ran across a small bug in FCgiIO.cpp,
FCgiIO class constructor.

In the environment parse routine:
for(char **e = fRequest.envp; *e != NULL; ++e) {
    STDNS string s(*e);
    STDNS string::size_type i = s.find('=');
    if(i != STDNS string::npos)
      throw STDNS runtime_error("Illegally formed
environment");
    fEnv[s.substr(0, i)] = s.substr(i + 1);
}

It looks like "if(i != STDNS string::npos)" should be
"if(i == STDNS string::pos)".

Hope this is of some use
-- Craig


__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/