diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2013-08-08 11:57:05 +1000 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2013-08-08 13:46:13 -0700 |
commit | f3d62276d20750e636fc82bc89b3c4c23576299d (patch) | |
tree | 05fee3d04531b3e3b303d82a546e26c1f1d96d81 /clients/terminal.c | |
parent | b1bc4a68b0bc2d7b391c7484a52a46a636ad89fc (diff) | |
download | weston-f3d62276d20750e636fc82bc89b3c4c23576299d.tar.gz |
malloc + memset -> zalloc
And for clients using the xmalloc helper, use xzalloc.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'clients/terminal.c')
-rw-r--r-- | clients/terminal.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/clients/terminal.c b/clients/terminal.c index 1cc26d0e..32d738c8 100644 --- a/clients/terminal.c +++ b/clients/terminal.c @@ -710,12 +710,10 @@ terminal_resize_cells(struct terminal *terminal, int width, int height) data_pitch = width * sizeof(union utf8_char); size = data_pitch * height; - data = malloc(size); + data = zalloc(size); attr_pitch = width * sizeof(struct attr); data_attr = malloc(attr_pitch * height); - tab_ruler = malloc(width); - memset(data, 0, size); - memset(tab_ruler, 0, width); + tab_ruler = zalloc(width); attr_init(data_attr, terminal->curr_attr, width * height); if (terminal->data && terminal->data_attr) { if (width > terminal->width) @@ -2552,9 +2550,7 @@ terminal_create(struct display *display) cairo_t *cr; cairo_text_extents_t text_extents; - terminal = xmalloc(sizeof *terminal); - - memset(terminal, 0, sizeof *terminal); + terminal = xzalloc(sizeof *terminal); terminal->color_scheme = &DEFAULT_COLORS; terminal_init(terminal); terminal->margin_top = 0; |