Source-Changes-HG archive

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

[src/trunk]: src remove recallocarray



details:   https://anonhg.NetBSD.org/src/rev/9e5bc4c2386f
branches:  trunk
changeset: 356677:9e5bc4c2386f
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 07 21:15:48 2017 +0000

description:
remove recallocarray

diffstat:

 include/stdlib.h               |   3 +--
 lib/libc/stdlib/reallocarray.c |  17 ++---------------
 2 files changed, 3 insertions(+), 17 deletions(-)

diffs (55 lines):

diff -r 25a8c022013a -r 9e5bc4c2386f include/stdlib.h
--- a/include/stdlib.h  Sat Oct 07 21:14:59 2017 +0000
+++ b/include/stdlib.h  Sat Oct 07 21:15:48 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: stdlib.h,v 1.118 2017/10/07 19:38:09 christos Exp $    */
+/*     $NetBSD: stdlib.h,v 1.119 2017/10/07 21:16:06 christos Exp $    */
 
 /*-
  * Copyright (c) 1990, 1993
@@ -126,7 +126,6 @@
 #ifdef _OPENBSD_SOURCE
 long long strtonum(const char *, long long, long long, const char **);
 void   *reallocarray(void *, size_t, size_t);
-void   *recallocarray(void *, size_t, size_t, size_t);
 #endif
 int     system(const char *);
 
diff -r 25a8c022013a -r 9e5bc4c2386f lib/libc/stdlib/reallocarray.c
--- a/lib/libc/stdlib/reallocarray.c    Sat Oct 07 21:14:59 2017 +0000
+++ b/lib/libc/stdlib/reallocarray.c    Sat Oct 07 21:15:48 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: reallocarray.c,v 1.8 2017/10/07 19:38:35 christos Exp $        */
+/*     $NetBSD: reallocarray.c,v 1.9 2017/10/07 21:15:48 christos Exp $        */
 /*     $OpenBSD: reallocarray.c,v 1.1 2014/05/08 21:43:49 deraadt Exp $        */
 
 /*-
@@ -31,11 +31,10 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: reallocarray.c,v 1.8 2017/10/07 19:38:35 christos Exp $");
+__RCSID("$NetBSD: reallocarray.c,v 1.9 2017/10/07 21:15:48 christos Exp $");
 
 #define _OPENBSD_SOURCE
 #include <errno.h>
-#include <string.h>
 #include <stdlib.h>
 
 void *
@@ -52,15 +51,3 @@
        errno = e;
        return NULL;
 }
-
-void *
-recallocarray(void *optr, size_t omemb, size_t nmemb, size_t size)
-{
-       char *nptr = reallocarray(optr, nmemb, size);
-
-       if (nptr == NULL || omemb >= nmemb)
-               return nptr;
-
-       memset(nptr + omemb * size, 0, (nmemb - omemb) * size);
-       return nptr;
-}



Home | Main Index | Thread Index | Old Index