summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorenami <enami@NetBSD.org>2002-03-21 03:26:55 +0000
committerenami <enami@NetBSD.org>2002-03-21 03:26:55 +0000
commit4aaba8dea10dc7ab222010574b7e87fe836f67a5 (patch)
treeae83c3267afe565e100d73e355e86050f9e1907b /sys/dev
parentaddff245d7dfd6b3fbfadf3b9fb70ffb03c6988a (diff)
- Allocate enough space to hold an object.
- No need to request to zero clear when we overwrite soon.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/wsfont/wsfont.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/dev/wsfont/wsfont.c b/sys/dev/wsfont/wsfont.c
index 15c1a44da6f..27fabf45920 100644
--- a/sys/dev/wsfont/wsfont.c
+++ b/sys/dev/wsfont/wsfont.c
@@ -1,4 +1,4 @@
-/* $NetBSD: wsfont.c,v 1.27 2002/03/20 12:18:56 ad Exp $ */
+/* $NetBSD: wsfont.c,v 1.28 2002/03/21 03:26:55 enami Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.27 2002/03/20 12:18:56 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wsfont.c,v 1.28 2002/03/21 03:26:55 enami Exp $");
#include "opt_wsfont.h"
@@ -340,7 +340,7 @@ wsfont_add0(struct wsdisplay_font *font, int copy)
struct font *ent;
size_t size;
- ent = malloc(sizeof(struct font *), M_DEVBUF, M_WAITOK | M_ZERO);
+ ent = malloc(sizeof(struct font), M_DEVBUF, M_WAITOK | M_ZERO);
/* Is this font statically allocated? */
if (!copy) {
@@ -348,7 +348,7 @@ wsfont_add0(struct wsdisplay_font *font, int copy)
ent->flags = WSFONT_STATIC;
} else {
ent->font = malloc(sizeof(struct wsdisplay_font), M_DEVBUF,
- M_WAITOK | M_ZERO);
+ M_WAITOK);
memcpy(ent->font, font, sizeof(*ent->font));
size = font->fontheight * font->numchars * font->stride;