diff options
author | dholland <dholland@NetBSD.org> | 2011-08-06 20:18:26 +0000 |
---|---|---|
committer | dholland <dholland@NetBSD.org> | 2011-08-06 20:18:26 +0000 |
commit | 9454bf2a02784b7f28fbab922d3d8b56b2193786 (patch) | |
tree | a5acc680f74543e2bb47b6067344e7e9e5759f5d /hack/hack.topl.c | |
parent | a96166e2f80ef376b0a2cdea16f09df48fe56d8c (diff) | |
download | bsdgames-darwin-9454bf2a02784b7f28fbab922d3d8b56b2193786.tar.gz bsdgames-darwin-9454bf2a02784b7f28fbab922d3d8b56b2193786.tar.zst bsdgames-darwin-9454bf2a02784b7f28fbab922d3d8b56b2193786.zip |
Use the right type for the malloc wrapper function, and don't cast the
return value.
(XXX: Except for a pile of allocation macros that produce typed pointer
results; there the typechecking of the result assignment is more valuable
than the warning if the alloc function isn't declared properly. These
macros should go away.)
Diffstat (limited to 'hack/hack.topl.c')
-rw-r--r-- | hack/hack.topl.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/hack/hack.topl.c b/hack/hack.topl.c index e5b8a856..c24b70fb 100644 --- a/hack/hack.topl.c +++ b/hack/hack.topl.c @@ -1,4 +1,4 @@ -/* $NetBSD: hack.topl.c,v 1.12 2009/08/12 07:28:41 dholland Exp $ */ +/* $NetBSD: hack.topl.c,v 1.13 2011/08/06 20:18:26 dholland Exp $ */ /* * Copyright (c) 1985, Stichting Centrum voor Wiskunde en Informatica, @@ -63,7 +63,7 @@ #include <sys/cdefs.h> #ifndef lint -__RCSID("$NetBSD: hack.topl.c,v 1.12 2009/08/12 07:28:41 dholland Exp $"); +__RCSID("$NetBSD: hack.topl.c,v 1.13 2011/08/06 20:18:26 dholland Exp $"); #endif /* not lint */ #include <stdlib.h> @@ -123,8 +123,7 @@ remember_topl(void) !strcmp(toplines, old_toplines->topl_text)) return; last_redone_topl = 0; - tl = (struct topl *) - alloc((unsigned) (strlen(toplines) + sizeof(struct topl) + 1)); + tl = alloc(strlen(toplines) + sizeof(*tl) + 1); tl->next_topl = old_toplines; tl->topl_text = (char *) (tl + 1); (void) strcpy(tl->topl_text, toplines); |