comparison ui.c @ 634:5269a8cdbd96

Use th_malloc0(n) instead of th_calloc(1, n).
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 22 Jun 2014 03:32:39 +0300
parents 2c6945599b16
children fc19ab0334b1
comparison
equal deleted inserted replaced
633:ce605ac8167a 634:5269a8cdbd96
26 } 26 }
27 27
28 28
29 static nn_window_t *nn_window_new(const char *id) 29 static nn_window_t *nn_window_new(const char *id)
30 { 30 {
31 nn_window_t *res = th_calloc(1, sizeof(nn_window_t)); 31 nn_window_t *res = th_malloc0(sizeof(nn_window_t));
32 32
33 if (res == NULL) return NULL; 33 if (res == NULL) return NULL;
34 34
35 res->data = th_ringbuf_new(SET_BACKBUF_LEN, nn_line_free); 35 res->data = th_ringbuf_new(SET_BACKBUF_LEN, nn_line_free);
36 if (res->data == NULL) 36 if (res->data == NULL)
259 259
260 while (*s) 260 while (*s)
261 { 261 {
262 if (win->line == NULL) 262 if (win->line == NULL)
263 { 263 {
264 win->line = th_calloc(1, sizeof(nn_line_t)); 264 win->line = th_malloc0(sizeof(nn_line_t));
265 if (win->line == NULL) 265 if (win->line == NULL)
266 return -15; 266 return -15;
267 } 267 }
268 268
269 if (*s == '½') 269 if (*s == '½')