replaced char* by idents, minor fix in Firm codegen for call
[libfirm] / ir / adt / xmalloc.c
index 9511978..e44d8b0 100644 (file)
@@ -1,7 +1,14 @@
-/* Xmalloc --- never failing wrappers for malloc() & friends.
-   Copyright (C) 1995, 1996 Markus Armbruster */
-
-/* $Id$ */
+/*
+ * Project:     libFIRM
+ * File name:   ir/adt/xmalloc.c
+ * Purpose:     Xmalloc --- never failing wrappers for malloc() & friends.
+ * Author:      Markus Armbruster
+ * Modified by:
+ * Created:     1999 by getting from fiasco
+ * CVS-ID:      $Id$
+ * Copyright:   (c) 1995, 1996 Markus Armbruster
+ * Licence:     This file protected by GPL -  GNU GENERAL PUBLIC LICENSE.
+ */
 
 /* @@@ ToDo: replace this file with the one from liberty.
    [reimplement xstrdup, ... ] */
@@ -12,7 +19,8 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include "misc.h"
+
+#include "xmalloc.h"
 #include "panic.h"
 
 
@@ -22,6 +30,9 @@ void *
   void *res = malloc (size);
 
   if (!res) xnomem ();
+
+  memset (res, 0x00, size);
+
   return res;
 }
 
@@ -33,6 +44,7 @@ void *
   void *res = ptr ? realloc (ptr, size) : malloc (size);
 
   if (!res) xnomem ();
+
   return res;
 }