]> code.delx.au - gnu-emacs/commitdiff
Cast result of malloc and realloc.
authorRichard M. Stallman <rms@gnu.org>
Sat, 15 Feb 2003 10:53:55 +0000 (10:53 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 15 Feb 2003 10:53:55 +0000 (10:53 +0000)
Don't include stdlib.h, becuase config.h does.
(malloc, realloc): Declarations deleted.

lib-src/cvtmail.c

index 453267f4aad63abc04d29275f4b1d01f79c9fbac..5a4d3c70952cffdd62318dba182a4ff060ed277d 100644 (file)
@@ -40,11 +40,7 @@ Boston, MA 02111-1307, USA.  */
 #include <stdio.h>
 
 #ifndef HAVE_STDLIB_H
-char *malloc ();
-char *realloc ();
 char *getenv ();
-#else
-#include <stdlib.h>
 #endif
 
 char *xmalloc __P ((unsigned));
@@ -168,7 +164,7 @@ char *
 xmalloc (size)
      unsigned size;
 {
-  char *result = malloc (size);
+  char *result = (char *) malloc (size);
   if (!result)
     fatal ("virtual memory exhausted", 0);
   return result;
@@ -179,7 +175,7 @@ xrealloc (ptr, size)
      char *ptr;
      unsigned size;
 {
-  char *result = realloc (ptr, size);
+  char *result = (char *) realloc (ptr, size);
   if (!result)
     fatal ("virtual memory exhausted", 0);
   return result;