BSD-style copyright

This commit is contained in:
Todd C. Miller
1999-07-22 12:39:07 +00:00
parent 3d5c6fc256
commit 1403ace084

64
alloc.c
View File

@@ -1,28 +1,28 @@
/* /*
* CU sudo version 1.6
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
* All rights reserved.
* *
* This program is free software; you can redistribute it and/or modify * Redistribution and use in source and binary forms, with or without
* it under the terms of the GNU General Public License as published by * modification, are permitted provided that the following conditions
* the Free Software Foundation; either version 1, or (at your option) * are met:
* any later version. * 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.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
* *
* This program is distributed in the hope that it will be useful, * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
* but WITHOUT ANY WARRANTY; without even the implied warranty of * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
* GNU General Public License for more details. * THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* You should have received a copy of the GNU General Public License * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* along with this program; if not, write to the Free Software * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* Please send bugs, changes, problems to sudo-bugs@courtesan.com * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*******************************************************************
*
* This module contains memory allocation routines used by sudo.
*
* Todd C. Miller <Todd.Miller@courtesan.com> Fri Jun 3 18:32:19 MDT 1994
*/ */
#include "config.h" #include "config.h"
@@ -44,9 +44,9 @@
#include "compat.h" #include "compat.h"
#ifndef STDC_HEADERS #ifndef STDC_HEADERS
#ifndef __GNUC__ / *gcc has its own malloc */ #if !defined(__GNUC__) && !defined(HAVE_MALLOC_H)
extern VOID *malloc __P((size_t)); extern VOID *malloc __P((size_t));
#endif /* __GNUC__ */ #endif /* !__GNUC__ && !HAVE_MALLOC_H */
#endif /* !STDC_HEADERS */ #endif /* !STDC_HEADERS */
extern char **Argv; /* from sudo.c */ extern char **Argv; /* from sudo.c */
@@ -56,14 +56,10 @@ static const char rcsid[] = "$Sudo$";
#endif /* lint */ #endif /* lint */
/********************************************************************** /*
*
* emalloc()
*
* emalloc() calls the system malloc(3) and exits with an error if * emalloc() calls the system malloc(3) and exits with an error if
* malloc(3) fails. * malloc(3) fails.
*/ */
VOID * VOID *
emalloc(size) emalloc(size)
size_t size; size_t size;
@@ -77,15 +73,11 @@ emalloc(size)
return(ptr); return(ptr);
} }
/********************************************************************** /*
*
* erealloc()
*
* erealloc() calls the system realloc(3) and exits with an error if * erealloc() calls the system realloc(3) and exits with an error if
* realloc(3) fails. You can call erealloc() with a NULL pointer even * realloc(3) fails. You can call erealloc() with a NULL pointer even
* if the system realloc(3) does not support this. * if the system realloc(3) does not support this.
*/ */
VOID * VOID *
erealloc(ptr, size) erealloc(ptr, size)
VOID *ptr; VOID *ptr;
@@ -99,14 +91,10 @@ erealloc(ptr, size)
return(ptr); return(ptr);
} }
/********************************************************************** /*
*
* estrdup()
*
* estrdup() is like strdup(3) except that it exits with an error if * estrdup() is like strdup(3) except that it exits with an error if
* malloc(3) fails. NOTE: unlike strdup(3), estrdup(NULL) is legal. * malloc(3) fails. NOTE: unlike strdup(3), estrdup(NULL) is legal.
*/ */
char * char *
estrdup(src) estrdup(src)
const char *src; const char *src;