X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/bd9d61269b77d4cdaa3143905aa1621c6d7a4ff6..a1069e498ca56abe42d4eac4a400365139b361cc:/hack/alloc.c diff --git a/hack/alloc.c b/hack/alloc.c index ed2f5630..8f2405e3 100644 --- a/hack/alloc.c +++ b/hack/alloc.c @@ -1,4 +1,4 @@ -/* $NetBSD: alloc.c,v 1.8 2010/01/17 22:55:20 wiz Exp $ */ +/* $NetBSD: alloc.c,v 1.9 2011/08/06 20:18:26 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,21 +63,22 @@ #include #ifndef lint -__RCSID("$NetBSD: alloc.c,v 1.8 2010/01/17 22:55:20 wiz Exp $"); +__RCSID("$NetBSD: alloc.c,v 1.9 2011/08/06 20:18:26 dholland Exp $"); #endif /* not lint */ #include #include "hack.h" #include "extern.h" -long * -alloc(unsigned lth) +void * +alloc(size_t len) { - long *ptr; + void *ptr; - if (!(ptr = malloc(lth))) - panic("Cannot get %d bytes", lth); - return (ptr); + ptr = malloc(len); + if (ptr == NULL) + panic("Cannot get %zu bytes", len); + return ptr; } #if 0 /* unused */