trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From zw...@apache.org
Subject [4/4] git commit: TS-2595 Minor cleanup on strlcpy returns
Date Mon, 03 Mar 2014 14:37:38 GMT
TS-2595 Minor cleanup on strlcpy returns


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/b74425c0
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/b74425c0
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/b74425c0

Branch: refs/heads/master
Commit: b74425c05539466a37960f2d2c1f827f8dc65831
Parents: 871cd8b
Author: Leif Hedstrom <zwoop@apache.org>
Authored: Mon Mar 3 14:36:23 2014 +0000
Committer: Leif Hedstrom <zwoop@apache.org>
Committed: Mon Mar 3 14:37:06 2014 +0000

----------------------------------------------------------------------
 iocore/dns/DNS.cc | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/b74425c0/iocore/dns/DNS.cc
----------------------------------------------------------------------
diff --git a/iocore/dns/DNS.cc b/iocore/dns/DNS.cc
index 4ddf05f..a93b6c9 100644
--- a/iocore/dns/DNS.cc
+++ b/iocore/dns/DNS.cc
@@ -384,12 +384,10 @@ DNSEntry::init(const char *x, int len, int qtype_arg, Continuation*
acont,
     if (len) {
       len = len > (MAXDNAME - 1) ? (MAXDNAME - 1) : len;
       memcpy(qname, x, len);
-      qname_len = len;
-      orig_qname_len = qname_len;
       qname[len] = 0;
+      orig_qname_len = qname_len = len;
     } else {
-      ink_strlcpy(qname, x, MAXDNAME);
-      qname_len = strlen(qname);
+      qname_len = ink_strlcpy(qname, x, MAXDNAME);
       orig_qname_len = qname_len;
     }
   } else {                    //T_PTR


Mime
View raw message