Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/lib/libc/stdlib Pull up following revision(s) (requested ...
details: https://anonhg.NetBSD.org/src/rev/0b451aee046a
branches: netbsd-8
changeset: 434219:0b451aee046a
user: snj <snj%NetBSD.org@localhost>
date: Sun Aug 20 04:55:40 2017 +0000
description:
Pull up following revision(s) (requested by ginsbach in ticket #214):
lib/libc/stdlib/merge.c: revision 1.15
PR lib/50316: Gracefully handle a zero number of members argument.
Taken from FreeBSD (which fixed this same issue long ago).
diffstat:
lib/libc/stdlib/merge.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r bffc82ab9882 -r 0b451aee046a lib/libc/stdlib/merge.c
--- a/lib/libc/stdlib/merge.c Sun Aug 20 04:53:31 2017 +0000
+++ b/lib/libc/stdlib/merge.c Sun Aug 20 04:55:40 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: merge.c,v 1.14 2012/03/13 21:13:48 christos Exp $ */
+/* $NetBSD: merge.c,v 1.14.24.1 2017/08/20 04:55:40 snj Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "from: @(#)merge.c 8.2 (Berkeley) 2/14/94";
#else
-__RCSID("$NetBSD: merge.c,v 1.14 2012/03/13 21:13:48 christos Exp $");
+__RCSID("$NetBSD: merge.c,v 1.14.24.1 2017/08/20 04:55:40 snj Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -125,6 +125,9 @@
return (-1);
}
+ if (nmemb == 0)
+ return (0);
+
/*
* XXX
* Stupid subtraction for the Cray.
Home |
Main Index |
Thread Index |
Old Index