From b4bdc510c1dfe4fa6402f73b4364789b153af35f Mon Sep 17 00:00:00 2001
From: Fons Rademakers <Fons.Rademakers@cern.ch>
Date: Tue, 12 Oct 2010 10:15:40 +0000
Subject: [PATCH] use strlcat instead of strncat.

git-svn-id: http://root.cern.ch/svn/root/trunk@36312 27541ba8-7e3a-0410-8455-c3a389f83636
---
 proof/proofd/src/proofd.cxx | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/proof/proofd/src/proofd.cxx b/proof/proofd/src/proofd.cxx
index 4adc412328b..413d92bbefc 100644
--- a/proof/proofd/src/proofd.cxx
+++ b/proof/proofd/src/proofd.cxx
@@ -558,15 +558,15 @@ void ProofdExec()
       char *buf = (char *) vb;
       char *end = buf + len;
       const char name[] = "PROOF_ALLVARS=";
-      char *all = new char[strlen(name)+len]; // strlen("PROOF_ALLVARS=") = 14
-      strncpy(all, name, strlen(name)+len);
-      all[strlen(name)+len-1] = 0;
+      int alen = strlen(name)+len;
+      char *all = new char[alen]; // strlen("PROOF_ALLVARS=") = 14
+      strlcpy(all, name, alen);
       while (buf < end) {
          if (gDebug > 0) ErrorInfo("ProofdExec: setting: %s", buf);
          char *p = index(buf, '=');
          if (p) {
-            if (buf != (char *) vb) strncat(all, ",", 1); // skip the first one
-            strncat(all, buf, p-buf);
+            if (buf != (char *) vb) strlcat(all, ",", alen); // skip the first one
+            strlcat(all, buf, alen);
             putenv(buf);
          }
          buf += strlen(buf) + 1;
-- 
GitLab