pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/devel/bmake Don't use memcpy for overlapping ranges. B...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/b9c5c8994c64
branches:  trunk
changeset: 650000:b9c5c8994c64
user:      joerg <joerg%pkgsrc.org@localhost>
date:      Thu Apr 16 11:40:43 2015 +0000

description:
Don't use memcpy for overlapping ranges. Bump revision.

diffstat:

 devel/bmake/Makefile    |   3 ++-
 devel/bmake/files/job.c |  23 ++++++++---------------
 2 files changed, 10 insertions(+), 16 deletions(-)

diffs (69 lines):

diff -r 119bbc524f1e -r b9c5c8994c64 devel/bmake/Makefile
--- a/devel/bmake/Makefile      Thu Apr 16 10:59:42 2015 +0000
+++ b/devel/bmake/Makefile      Thu Apr 16 11:40:43 2015 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.67 2014/03/14 21:59:34 ryoon Exp $
+# $NetBSD: Makefile,v 1.68 2015/04/16 11:40:43 joerg Exp $
 
 DISTNAME=      bmake-20140314
+PKGREVISION=   1
 CATEGORIES=    devel
 MASTER_SITES=  # empty
 DISTFILES=     # empty
diff -r 119bbc524f1e -r b9c5c8994c64 devel/bmake/files/job.c
--- a/devel/bmake/files/job.c   Thu Apr 16 10:59:42 2015 +0000
+++ b/devel/bmake/files/job.c   Thu Apr 16 11:40:43 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: job.c,v 1.13 2013/02/26 00:50:14 christos Exp $        */
+/*     $NetBSD: job.c,v 1.14 2015/04/16 11:40:43 joerg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990 The Regents of the University of California.
@@ -70,14 +70,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: job.c,v 1.13 2013/02/26 00:50:14 christos Exp $";
+static char rcsid[] = "$NetBSD: job.c,v 1.14 2015/04/16 11:40:43 joerg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)job.c      8.2 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: job.c,v 1.13 2013/02/26 00:50:14 christos Exp $");
+__RCSID("$NetBSD: job.c,v 1.14 2015/04/16 11:40:43 joerg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -142,6 +142,7 @@
 #include <sys/time.h>
 #include "wait.h"
 
+#include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
 #if !defined(USE_SELECT) && defined(HAVE_POLL_H)
@@ -1892,18 +1893,10 @@
                (void)fflush(stdout);
            }
        }
-       if (i < max - 1) {
-           /* shift the remaining characters down */
-           (void)memcpy(job->outBuf, &job->outBuf[i + 1], max - (i + 1));
-           job->curPos = max - (i + 1);
-
-       } else {
-           /*
-            * We have written everything out, so we just start over
-            * from the start of the buffer. No copying. No nothing.
-            */
-           job->curPos = 0;
-       }
+       assert(i < max);
+       /* shift the remaining characters down */
+       (void)memmove(job->outBuf, &job->outBuf[i + 1], max - (i + 1));
+       job->curPos = max - (i + 1);
     }
     if (finish) {
        /*



Home | Main Index | Thread Index | Old Index