diff options
| author | Warner Losh <imp@FreeBSD.org> | 1998-09-16 03:16:06 +0000 | 
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 1998-09-16 03:16:06 +0000 | 
| commit | 9a5722f2e848eebb61a211eb46ccba1d46289f38 (patch) | |
| tree | 13f45adecc6a8fefedb4fc6a484842e1696ebe81 /lib/libc/stdlib/reallocf.c | |
| parent | 29218d94d3881b0a950d89ee8c1bc7e88cf39e6b (diff) | |
Notes
Diffstat (limited to 'lib/libc/stdlib/reallocf.c')
| -rw-r--r-- | lib/libc/stdlib/reallocf.c | 37 | 
1 files changed, 32 insertions, 5 deletions
diff --git a/lib/libc/stdlib/reallocf.c b/lib/libc/stdlib/reallocf.c index 728acc9af5792..6e279981a6fc0 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);  }  | 
