xref: /original-bsd/bin/test/stalloc.c (revision 16bc4816)
1 /*
2  * Copyright (c) 1988 The Regents of the University of California.
3  * All rights reserved.
4  *
5  * This code is derived from software contributed to Berkeley by
6  * Kenneth Almquist.
7  *
8  * %sccs.include.redist.c%
9  */
10 
11 #ifndef lint
12 static char copyright[] =
13 "@(#) Copyright (c) 1988 The Regents of the University of California.\n\
14  All rights reserved.\n";
15 #endif /* not lint */
16 
17 #ifndef lint
18 static char sccsid[] = "@(#)stalloc.c	1.2 (Berkeley) 06/03/92";
19 #endif /* not lint */
20 
21 #include <stdio.h>
22 #include <stdlib.h>
23 
24 void *
25 stalloc(nbytes)
26 	int nbytes;
27 {
28       register void *p;
29 
30       if ((p = malloc(nbytes)) == NULL)
31 	    error("Out of space");
32       return p;
33 }
34