]> mj.ucw.cz Git - libucw.git/blobdiff - lib/alloc.c
sign mismatch fixed
[libucw.git] / lib / alloc.c
index 127e63cabfcd4ead9b62e5d4206b3e4aa63aee1f..075321436c44f1dba1ffb54d5098d5248fd60b64 100644 (file)
@@ -1,14 +1,14 @@
 /*
  *     Sherlock Library -- Memory Allocation
  *
 /*
  *     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/lib.h"
 
+#include <stdlib.h>
+#include <string.h>
+
 void *
 xmalloc(uns size)
 {
 void *
 xmalloc(uns size)
 {
@@ -17,3 +17,11 @@ xmalloc(uns size)
     die("Cannot allocate %d bytes of memory", size);
   return x;
 }
     die("Cannot allocate %d bytes of memory", size);
   return x;
 }
+
+void *
+xmalloc_zero(uns size)
+{
+  void *x = xmalloc(size);
+  bzero(x, size);
+  return x;
+}