summaryrefslogtreecommitdiff
path: root/devel/bmake
diff options
context:
space:
mode:
authorjoerg <joerg@pkgsrc.org>2015-04-16 11:40:43 +0000
committerjoerg <joerg@pkgsrc.org>2015-04-16 11:40:43 +0000
commit71994e15ee29ff0b91bc9fb73f2ed4939836734c (patch)
tree16d7f660760d8a574d943fd1dd7137d1d1b71df7 /devel/bmake
parent4e964596ed225e37dddabafae102ae551658f04c (diff)
downloadpkgsrc-71994e15ee29ff0b91bc9fb73f2ed4939836734c.tar.gz
Don't use memcpy for overlapping ranges. Bump revision.
Diffstat (limited to 'devel/bmake')
-rw-r--r--devel/bmake/Makefile3
-rw-r--r--devel/bmake/files/job.c23
2 files changed, 10 insertions, 16 deletions
diff --git a/devel/bmake/Makefile b/devel/bmake/Makefile
index 2c0f7694dca..329f3f6a7cd 100644
--- a/devel/bmake/Makefile
+++ b/devel/bmake/Makefile
@@ -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 --git a/devel/bmake/files/job.c b/devel/bmake/files/job.c
index 919f758b1d4..a8179588605 100644
--- a/devel/bmake/files/job.c
+++ b/devel/bmake/files/job.c
@@ -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 @@ __RCSID("$NetBSD: job.c,v 1.13 2013/02/26 00:50:14 christos Exp $");
#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 @@ end_loop:
(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) {
/*