Module Name: src
Committed By: joerg
Date: Mon Apr 14 18:18:58 UTC 2014
Modified Files:
src/common/lib/libc/string: bcopy.c
Log Message:
Using bcopy/memcpy with NULL arguments is valid as long as the size is
also 0.
To generate a diff of this commit:
cvs rdiff -u -r1.9 -r1.10 src/common/lib/libc/string/bcopy.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/common/lib/libc/string/bcopy.c
diff -u src/common/lib/libc/string/bcopy.c:1.9 src/common/lib/libc/string/bcopy.c:1.10
--- src/common/lib/libc/string/bcopy.c:1.9 Wed Mar 18 12:25:06 2009
+++ src/common/lib/libc/string/bcopy.c Mon Apr 14 18:18:58 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: bcopy.c,v 1.9 2009/03/18 12:25:06 tsutsui Exp $ */
+/* $NetBSD: bcopy.c,v 1.10 2014/04/14 18:18:58 joerg Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: bcopy.c,v 1.9 2009/03/18 12:25:06 tsutsui Exp $");
+__RCSID("$NetBSD: bcopy.c,v 1.10 2014/04/14 18:18:58 joerg Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -89,8 +89,7 @@ bcopy(const void *src0, void *dst0, size
unsigned long u;
#if !defined(_KERNEL)
- _DIAGASSERT(dst0 != 0);
- _DIAGASSERT(src0 != 0);
+ _DIAGASSERT((dst0 && src0) || length == 0);
#endif
if (length == 0 || dst == src) /* nothing to do */