]> Pileus Git - lackey/blobdiff - src/util.c
Add alloc0 and new0 functions
[lackey] / src / util.c
index e3f3a43a8015cb630302d507b45c66f8f7b43a02..131e9dea2e6261ccf4823030e4bde638a2bcff1d 100644 (file)
@@ -75,6 +75,15 @@ void strsub(char *str, char find, char repl)
                        *cur = repl;
 }
 
+/* Memory functions */
+void *alloc0(int size)
+{
+       void *data = calloc(1, size);
+       if (!data)
+               error("memory allocation failed");
+       return data;
+}
+
 /* Debugging functions */
 void debug(char *fmt, ...)
 {