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

Comparing HostUpdate/Host.cpp (file contents):
Revision 15 by Douglas Thrift, 2003-11-09T16:51:42-08:00 vs.
Revision 22 by Douglas Thrift, 2003-11-10T23:58:38-08:00

# Line 6 | Line 6
6  
7   #include "Host.hpp"
8  
9 #ifndef _WIN32
10
11 static char slash = '/';
12
13 #else
14
15 static char slash = '\\';
16
17 #endif
18
9   Host::Host(const string& host, const string& name, const string& address, const
10          string& platform)
11   {
12 +        memset(&this->address, 0, sizeof(in_addr));
13 +
14   #ifdef _WIN32
15          if (count == 0)
16          {
# Line 73 | Line 65 | void Host::setAddress(const string& addr
65          if (value == INADDR_NONE)
66          {
67                  cerr << "Host.setAddress(): INADDR_NONE\n";
76                exit(1);
68          }
69          else
70          {
# Line 126 | Line 117 | Host Host::operator++()
117                  getline(fin, name);
118  
119                  string address;
120 <                
120 >
121                  getline(fin, address);
122  
123                  in_addr_t value = inet_addr(address.c_str());
# Line 134 | Line 125 | Host Host::operator++()
125                  if (value == INADDR_NONE)
126                  {
127                          cerr << "Host.operator++(): INADDR_NONE\n";
137                        exit(1);
128                  }
129                  else
130                  {
# Line 160 | Line 150 | Host Host::operator++(int)
150   Host Host::operator--()
151   {
152          string file = string("hosts") + slash + host;
153 <        
153 >
154          ofstream fout(file.c_str());
155  
156          fout << name << '\n'

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines