ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/repos/HostUpdate/HostUpdate.cpp
(Generate patch)

Comparing HostUpdate/HostUpdate.cpp (file contents):
Revision 22 by Douglas Thrift, 2003-11-10T23:58:38-08:00 vs.
Revision 24 by Douglas Thrift, 2003-11-11T12:33:38-08:00

# Line 81 | Line 81 | void HostUpdate::mode()
81                  false;
82  
83          for (multimap<string, string>::iterator itor = cgi.find("mode"); itor !=
84 <                cgi.upper_bound("mode"); itor++)
84 >                cgi.upper_bound("mode") && itor != cgi.end(); itor++)
85          {
86                  string mode = itor->second;
87  
# Line 128 | Line 128 | void HostUpdate::update(const string& ag
128          string host = itor->second, name = sgetenv("REMOTE_HOST"), address =
129             sgetenv("REMOTE_ADDR");
130  
131 <        string::size_type begin = agent.find('(') + 1, end = agent.find(')',
132 <                begin);
131 >        string::size_type begin = agent.find('(') + 1, end = agent.rfind(')');
132 >
133 >        if (begin >= end) return;
134 >
135          string platform = agent.substr(begin, end - begin);
136  
137          Host client(host, name, address, platform), saved(host);
# Line 147 | Line 149 | void HostUpdate::display()
149                  bool request = false;
150  
151                  for (multimap<string, string>::iterator itor = cgi.find("host"); itor !=
152 <                        cgi.upper_bound("host"); itor++)
152 >                        cgi.upper_bound("host") && itor != cgi.end(); itor++)
153                  {
154                          if (itor->second != "")
155                          {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines