opkg: adding the hash_table_remove API, not using yet.
[oweals/opkg-lede.git] / libopkg / sprintf_alloc.c
index 8c669949670502d9852084a5a64bf12bae5d7408..30ab033d257dabc8f378125f853f1ed4039da8ca 100644 (file)
@@ -44,7 +44,7 @@ int sprintf_alloc(char **str, const char *fmt, ...)
 
     /* ripped more or less straight out of PRINTF(3) */
 
-    if ((new_str = malloc(size)) == NULL) 
+    if ((new_str = calloc(1, size)) == NULL) 
       return -1;
 
     *str = new_str;