libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: 101-gary-pre-ANSI-replace-memcpy-memmove.patch


From: Gary V. Vaughan
Subject: FYI: 101-gary-pre-ANSI-replace-memcpy-memmove.patch
Date: Mon, 13 Sep 2004 14:07:41 +0100 (BST)
User-agent: mailnotify/0.3

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Applied to HEAD.
- -- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook
__________________________________________________________
This patch notification generated by cvsapply version 0.13
http://savannah.gnu.org/projects/cvs-utils
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (Darwin)

iD8DBQFBRZudFRMICSmD1gYRAk3UAKCZotqj3Hlcr3TCr4O1UGIZjAwpAwCgyJHQ
ugA/+R7suUxBVbc5CM7ftgE=
=8uT9
-----END PGP SIGNATURE-----
Index: ChangeLog
from  Ralf Wildenhues  <address@hidden>

        * ltdl.c (memcpy, memmove): Fix pre-ANSI replacement functions
        to not use pointer-to-void arithmetic.
        (memmove): Fix infinite loop.

        * libtool.m4 (LT_AC_PROG_SED): Set SED when running from cache as
        * libtool.m4: Treat bsdi5* like bsdi4*.
Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.174.2.7
diff -u -p -u -r1.174.2.7 ltdl.c
--- libltdl/ltdl.c 23 Jan 2004 06:04:53 -0000 1.174.2.7
+++ libltdl/ltdl.c 13 Sep 2004 12:45:28 -0000
@@ -1,5 +1,5 @@
 /* ltdl.c -- system independent dlopen wrapper
-   Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+   Copyright (C) 1998, 1999, 2000, 2004 Free Software Foundation, Inc.
    Originally by Thomas Tanner <address@hidden>
    This file is part of GNU Libtool.
 
@@ -385,11 +385,13 @@ memcpy (dest, src, size)
      const lt_ptr src;
      size_t size;
 {
-  size_t i = 0;
+  const char * s = src;
+  char *       d = dest;
+  size_t       i = 0;
 
   for (i = 0; i < size; ++i)
     {
-      dest[i] = src[i];
+      d[i] = s[i];
     }
 
   return dest;
@@ -409,17 +411,21 @@ memmove (dest, src, size)
      const lt_ptr src;
      size_t size;
 {
-  size_t i;
+  const char * s = src;
+  char *       d = dest;
+  size_t       i;
 
-  if (dest < src)
+  if (d < s)
     for (i = 0; i < size; ++i)
       {
-       dest[i] = src[i];
+       d[i] = s[i];
       }
-  else if (dest > src)
-    for (i = size -1; i >= 0; --i)
+  else if (d > s && size > 0)
+    for (i = size -1; ; --i)
       {
-       dest[i] = src[i];
+       d[i] = s[i];
+       if (i == 0)
+         break;
       }
 
   return dest;

reply via email to

[Prev in Thread] Current Thread [Next in Thread]