]> mj.ucw.cz Git - libucw.git/blobdiff - lib/alloc.c
sign mismatch fixed
[libucw.git] / lib / alloc.c
index c72851eec33c7cf4eebdb27e9ff6c9421aabff5b..075321436c44f1dba1ffb54d5098d5248fd60b64 100644 (file)
@@ -1,13 +1,13 @@
 /*
  *     Sherlock Library -- Memory Allocation
  *
- *     (c) 1997 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
+ *     (c) 2000 Martin Mares <mj@ucw.cz>
  */
 
-#include <stdio.h>
-#include <stdlib.h>
+#include "lib/lib.h"
 
-#include "lib.h"
+#include <stdlib.h>
+#include <string.h>
 
 void *
 xmalloc(uns size)
@@ -17,3 +17,11 @@ xmalloc(uns size)
     die("Cannot allocate %d bytes of memory", size);
   return x;
 }
+
+void *
+xmalloc_zero(uns size)
+{
+  void *x = xmalloc(size);
+  bzero(x, size);
+  return x;
+}