]> 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:05:26 +0000 (21:05 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Mon, 29 Nov 2004 21:05:26 +0000 (21:05 +0000)
avoid problems with non-conforming strncpy.  This is safe here.

ChangeLog
libltdl/ltdl.c

index 0d48b6751dbfe3e58bd86c2b89a2d3d0a220ef4e..bf2c34cdf916ff1e8afb77f0d864b2fbdeb6f427 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 0b0b297e825e56bd396bb73af1cbddcf20e7a760..eb088a0536e728d4afc213d61ab69913a16c538f 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;
     }