[darwinbuild-changes] [499] branches/PR-6722857/darwinup

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 26 13:14:22 PDT 2009


Revision: 499
          http://trac.macosforge.org/projects/darwinbuild/changeset/499
Author:   wsiegrist at apple.com
Date:     2009-03-26 13:14:22 -0700 (Thu, 26 Mar 2009)
Log Message:
-----------
Use strlcpy instead of strncpy

Modified Paths:
--------------
    branches/PR-6722857/darwinup/Depot.cpp
    branches/PR-6722857/darwinup/Utils.cpp

Modified: branches/PR-6722857/darwinup/Depot.cpp
===================================================================
--- branches/PR-6722857/darwinup/Depot.cpp	2009-03-26 20:08:54 UTC (rev 498)
+++ branches/PR-6722857/darwinup/Depot.cpp	2009-03-26 20:14:22 UTC (rev 499)
@@ -361,7 +361,7 @@
 				char* backup_dirpath;
 
 				// we need the path minus our destination prefix for moving to the archive
-				strncpy(path, actual->path() + strlen(m_prefix) - 1, sizeof(path));
+				strlcpy(path, actual->path() + strlen(m_prefix) - 1, sizeof(path));
 
 				const char* dir = dirname(path);
 				assert(dir != NULL);

Modified: branches/PR-6722857/darwinup/Utils.cpp
===================================================================
--- branches/PR-6722857/darwinup/Utils.cpp	2009-03-26 20:08:54 UTC (rev 498)
+++ branches/PR-6722857/darwinup/Utils.cpp	2009-03-26 20:14:22 UTC (rev 499)
@@ -60,7 +60,7 @@
 
                 if (res != 0 && errno == ENOENT) {
                         char tmp[PATH_MAX];
-                        strncpy(tmp, path, PATH_MAX);
+                        strlcpy(tmp, path, PATH_MAX);
                         char* slash = strrchr(tmp, '/');
                         if (slash) { *slash = 0; }
                         res = mkdir_p(tmp);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/darwinbuild-changes/attachments/20090326/5858d9cf/attachment.html>


More information about the darwinbuild-changes mailing list