summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1998-09-16 03:16:06 +0000
committerimp <imp@FreeBSD.org>1998-09-16 03:16:06 +0000
commitf706ca01b7f767dba1bd3c3b1cc66f9ab11ac513 (patch)
tree6269826a40a9c4adc89a5f15870fe767c976fcd5 /lib
parent7bf4199b5f595761cb8b9176aeee442f69b7545c (diff)
downloadFreeBSD-src-f706ca01b7f767dba1bd3c3b1cc66f9ab11ac513.zip
FreeBSD-src-f706ca01b7f767dba1bd3c3b1cc66f9ab11ac513.tar.gz
Fix style problems noted by Bruce:
o No copyright on reallocf. o Order makefile list correctly. o indent reallocf properly.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdlib/Makefile.inc6
-rw-r--r--lib/libc/stdlib/reallocf.c37
2 files changed, 35 insertions, 8 deletions
diff --git a/lib/libc/stdlib/Makefile.inc b/lib/libc/stdlib/Makefile.inc
index 5ba11f9..8d59f46 100644
--- a/lib/libc/stdlib/Makefile.inc
+++ b/lib/libc/stdlib/Makefile.inc
@@ -1,5 +1,5 @@
# from @(#)Makefile.inc 8.3 (Berkeley) 2/4/95
-# $Id: Makefile.inc,v 1.15 1998/05/08 05:41:56 jb Exp $
+# $Id: Makefile.inc,v 1.16 1998/09/14 20:34:34 imp Exp $
# machine-independent stdlib sources
.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/stdlib ${.CURDIR}/../libc/stdlib
@@ -7,8 +7,8 @@
MISRCS+=abort.c abs.c atexit.c atof.c atoi.c atol.c bsearch.c calloc.c div.c \
exit.c getenv.c getopt.c getsubopt.c heapsort.c labs.c ldiv.c \
malloc.c merge.c putenv.c qsort.c radixsort.c rand.c random.c \
- realpath.c setenv.c strhash.c strtol.c strtoq.c strtoul.c \
- strtouq.c system.c reallocf.c
+ reallocf.c realpath.c setenv.c strhash.c strtol.c strtoq.c strtoul.c \
+ strtouq.c system.c
.if ${MACHINE_ARCH} == "alpha"
# XXX Temporary until the assumption that a long is 32-bits is resolved
diff --git a/lib/libc/stdlib/reallocf.c b/lib/libc/stdlib/reallocf.c
index 728acc9..6e27998 100644
--- a/lib/libc/stdlib/reallocf.c
+++ b/lib/libc/stdlib/reallocf.c
@@ -1,12 +1,39 @@
+/*-
+ * Copyright (c) 1998, M. Warner Losh <imp@freebsd.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * $Id:$
+ */
#include <stdlib.h>
void *
reallocf(void *ptr, size_t size)
{
- void *nptr;
+ void *nptr;
- nptr = realloc(ptr, size);
- if (!nptr && ptr)
- free(ptr);
- return (nptr);
+ nptr = realloc(ptr, size);
+ if (!nptr && ptr)
+ free(ptr);
+ return (nptr);
}
OpenPOWER on IntegriCloud