From 52b3a2412b177e8f3acb56234bd98dc2810dc682 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Fri, 7 Jun 2002 13:28:37 +0000 Subject: xmalloc type cleanup. svn path=/trunk/; revision=3636 --- NEWS | 1 + fetchmail.h | 7 +++++-- xmalloc.c | 5 +++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 6851b774..1135fa29 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ (The `lines' figures total .c, .h, .l, and .y files under version control.) * Cygwin port fixes for socket.c. +* Matthias Andree's patch to clean up xmalloc types. fetchmail-5.9.12 (Tue Jun 4 14:57:47 EDT 2002), 21669 lines: diff --git a/fetchmail.h b/fetchmail.h index 1c1d4944..4d019a34 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -5,6 +5,9 @@ /* We need this for HAVE_STDARG_H, etc */ #include "config.h" +/* We need this for size_t */ +#include + /* constants designating the various supported protocols */ #define P_AUTO 1 #define P_POP2 2 @@ -549,8 +552,8 @@ int interface_approve(struct hostdata *, flag domonitor); #else #define XMALLOCTYPE char #endif -XMALLOCTYPE *xmalloc(int); -XMALLOCTYPE *xrealloc(XMALLOCTYPE *, int); +XMALLOCTYPE *xmalloc(size_t); +XMALLOCTYPE *xrealloc(/*@null@*/ XMALLOCTYPE *, size_t); char *xstrdup(const char *); #if defined(HAVE_ALLOCA_H) #include diff --git a/xmalloc.c b/xmalloc.c index 74365586..c5af357c 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -6,6 +6,7 @@ */ #include "config.h" +#include #include #include #include @@ -22,7 +23,7 @@ #endif XMALLOCTYPE * -xmalloc (int n) +xmalloc (size_t n) { XMALLOCTYPE *p; @@ -36,7 +37,7 @@ xmalloc (int n) } XMALLOCTYPE * -xrealloc (XMALLOCTYPE *p, int n) +xrealloc (XMALLOCTYPE *p, size_t n) { if (p == 0) return xmalloc (n); -- cgit v1.2.3