diff options
author | David Kalnischkies <david@kalnischkies.de> | 2014-01-16 22:19:49 +0100 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2014-01-16 22:19:49 +0100 |
commit | 9ce3cfc9309c55cc01018c88c1ca82779fd74431 (patch) | |
tree | e113a963a732f497d0362d3fff9e5b3834d5a175 /methods/connect.cc | |
parent | 62d8a765b9b37354efab6ca838cbdb7f347f7cac (diff) |
correct some style/performance/warnings from cppcheck
The most "visible" change is from utime to utimensat/futimens
as the first one isn't part of POSIX anymore.
Reported-By: cppcheck
Git-Dch: Ignore
Diffstat (limited to 'methods/connect.cc')
-rw-r--r-- | methods/connect.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/methods/connect.cc b/methods/connect.cc index fc7a72ee9..d9c9a1dd4 100644 --- a/methods/connect.cc +++ b/methods/connect.cc @@ -142,9 +142,9 @@ bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd, // Convert the port name/number char ServStr[300]; if (Port != 0) - snprintf(ServStr,sizeof(ServStr),"%u",Port); + snprintf(ServStr,sizeof(ServStr),"%i", Port); else - snprintf(ServStr,sizeof(ServStr),"%s",Service); + snprintf(ServStr,sizeof(ServStr),"%s", Service); /* We used a cached address record.. Yes this is against the spec but the way we have setup our rotating dns suggests that this is more @@ -190,7 +190,7 @@ bool Connect(std::string Host,int Port,const char *Service,int DefPort,int &Fd, { if (DefPort != 0) { - snprintf(ServStr,sizeof(ServStr),"%u",DefPort); + snprintf(ServStr, sizeof(ServStr), "%i", DefPort); DefPort = 0; continue; } |