changeset 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 ce605ac8167a
children 43eee625021a
files ui.c util.c
diffstat 2 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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;
         }
--- 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;