# HG changeset patch # User Matti Hamalainen # Date 1403397159 -10800 # Node ID 5269a8cdbd96815a3657427d88a80288f86f94fd # Parent ce605ac8167aeddc112e275688c0f3280eaadc67 Use th_malloc0(n) instead of th_calloc(1, n). diff -r ce605ac8167a -r 5269a8cdbd96 ui.c --- a/ui.c Sun Jun 22 02:12:37 2014 +0300 +++ b/ui.c Sun Jun 22 03:32:39 2014 +0300 @@ -28,7 +28,7 @@ static nn_window_t *nn_window_new(const char *id) { - nn_window_t *res = th_calloc(1, sizeof(nn_window_t)); + nn_window_t *res = th_malloc0(sizeof(nn_window_t)); if (res == NULL) return NULL; @@ -261,7 +261,7 @@ { if (win->line == NULL) { - win->line = th_calloc(1, sizeof(nn_line_t)); + win->line = th_malloc0(sizeof(nn_line_t)); if (win->line == NULL) return -15; } diff -r ce605ac8167a -r 5269a8cdbd96 util.c --- a/util.c Sun Jun 22 02:12:37 2014 +0300 +++ b/util.c Sun Jun 22 03:32:39 2014 +0300 @@ -382,7 +382,7 @@ nn_editbuf_t * nn_editbuf_new(size_t n) { - nn_editbuf_t *res = th_calloc(1, sizeof(nn_editbuf_t)); + nn_editbuf_t *res = th_malloc0(sizeof(nn_editbuf_t)); res->data = (char *) th_malloc(n); res->size = n; @@ -585,7 +585,7 @@ nn_userhash_t *nn_userhash_new(void) { - return th_calloc(1, sizeof(nn_userhash_t)); + return th_malloc0(sizeof(nn_userhash_t)); } @@ -603,7 +603,7 @@ return 1; // No, we'll add it - if ((user = th_calloc(1, sizeof(nn_user_t))) == NULL) + if ((user = th_malloc0(sizeof(nn_user_t))) == NULL) return -3; user->name = th_strdup(name); @@ -703,7 +703,7 @@ nn_strtuple_t *nn_strtuple_new(size_t len, char *str) { - nn_strtuple_t *tuple = th_calloc(1, sizeof(nn_strtuple_t)); + nn_strtuple_t *tuple = th_malloc0(sizeof(nn_strtuple_t)); tuple->len = len; tuple->str = str; return tuple;