]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/ltdl.c (trim): Use memcpy instead of strncpy here, to
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 29 Nov 2004 21:06:24 +0000 (21:06 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 29 Nov 2004 21:06:24 +0000 (21:06 +0000)
avoid problems with non-conforming strncpy.  This is safe here.

ChangeLog
libltdl/ltdl.c

index c1d74a270c0706cf88e5181a2e447ad031fd94d4..7f753a8f4ebbe617a93beb21ac6b55d9cce109eb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2004-11-29  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * libltdl/ltdl.c (trim): Use memcpy instead of strncpy here, to
+       avoid problems with non-conforming strncpy.  This is safe here.
+
        * m4/ltdl.m4 (LT_LIB_DLLOAD): Define HAVE_LIBDLLOADER if we
        have a dlloader to preload.
        * libltdl/ltdl.c (lt_dlinit): Only preload if HAVE_LIBDLLOADER, only
index fcbdc7cad0e97926f0e4480ae5f8da8f61d94244..c2be797916aa5d863f291814bd9f54acafea0170 100644 (file)
@@ -907,7 +907,7 @@ trim (char **dest, const char *str)
       if (!tmp)
        return 1;
 
-      strncpy(tmp, &str[1], (end - str) - 1);
+      memcpy(tmp, &str[1], (end - str) - 1);
       tmp[len-3] = LT_EOS_CHAR;
       *dest = tmp;
     }