diff options
author | jkh <jkh@FreeBSD.org> | 1995-05-01 21:56:32 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1995-05-01 21:56:32 +0000 |
commit | e3598880e349017837533ba4e1967b87751ddeff (patch) | |
tree | 66e8a7a94085501f4c4c4f035003b8f42ba879d5 /usr.sbin/sade/misc.c | |
parent | d0d51976ab3315b9d155a3551f319e36b88b260c (diff) | |
download | FreeBSD-src-e3598880e349017837533ba4e1967b87751ddeff.zip FreeBSD-src-e3598880e349017837533ba4e1967b87751ddeff.tar.gz |
Commit my latest changes before having a nap. Still not close to done,
nor is it in sync with my working sources, but it leaves me less CVS hassles
to bring in the new files at this time. Still no documentation to translate
quite yet, but soon. This stuff is actually very close now.
Diffstat (limited to 'usr.sbin/sade/misc.c')
-rw-r--r-- | usr.sbin/sade/misc.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/usr.sbin/sade/misc.c b/usr.sbin/sade/misc.c index 4f789e2..794c498 100644 --- a/usr.sbin/sade/misc.c +++ b/usr.sbin/sade/misc.c @@ -1,7 +1,7 @@ /* * Miscellaneous support routines.. * - * $Id: misc.c,v 1.1.1.1 1995/04/27 12:50:35 jkh Exp $ + * $Id: misc.c,v 1.2 1995/04/29 19:33:04 jkh Exp $ * * Copyright (c) 1995 * Jordan Hubbard. All rights reserved. @@ -98,6 +98,18 @@ safe_free(void *ptr) free(ptr); } +/* A malloc that checks errors */ +void * +safe_malloc(size_t size) +{ + void *ptr; + + ptr = malloc(size); + if (!ptr) + msgFatal("Out of memory!"); + return ptr; +} + /* * These next routines are kind of specialized just for building string lists * for dialog_menu(). |