Browse Source

minor style fix: treat "xxx" as std::string, not char *

git-svn-id: svn://bind10.isc.org/svn/bind10/branches/f2f200910@205 e5f2f494-b856-4b98-b285-d166d9295462
JINMEI Tatuya 15 years ago
parent
commit
9c2efb9ae0
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/bin/host/host.cc

+ 3 - 3
src/bin/host/host.cc

@@ -13,13 +13,13 @@ using namespace std;    // I don't understand why this is needed for cout
 using namespace isc::dns;
 
 char* dns_type = NULL;    // not set, so A, AAAA, MX
-char* server = "127.0.0.1";
+std::string server = "127.0.0.1";
 int   verbose = 1;       // later make this an option and default to 0
 int   first_time = 1;
 struct timeval before_time, after_time;
 
 int
-host_lookup(char* name, char* type)
+host_lookup(char* name, std::string type)
 {
 
     Message msg;
@@ -44,7 +44,7 @@ host_lookup(char* name, char* type)
     hints.ai_family = AF_UNSPEC;
     hints.ai_socktype = SOCK_DGRAM;
     hints.ai_flags = 0; // not using AI_NUMERICHOST in case to bootstrap
-    e = getaddrinfo(server, "53", &hints, &res);
+    e = getaddrinfo(server.c_str(), "53", &hints, &res);
 
     if (verbose) {
         cout << "Trying \"" << name << "\"\n";