summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/xmalloc.h
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-03-28 02:13:45 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-03-28 02:13:45 +0000
commitdfbe3f4f54568b5eedfe5695987a22e774114f2a (patch)
treeff9dd12a8cf0838ea8838e117f422cf9e7bbd587 /usr.bin/cvs/xmalloc.h
parent44e7e454767c74777de3725352a5d79f6529fe60 (diff)
Today is Integer Overflow Prevention Day:
- Sync xmalloc.? with ssh versions. - Change all xrealloc() calls to new API. ``I really like this.'' niallo@
Diffstat (limited to 'usr.bin/cvs/xmalloc.h')
-rw-r--r--usr.bin/cvs/xmalloc.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/cvs/xmalloc.h b/usr.bin/cvs/xmalloc.h
index b40cddd7fc5..736666950d2 100644
--- a/usr.bin/cvs/xmalloc.h
+++ b/usr.bin/cvs/xmalloc.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: xmalloc.h,v 1.1 2005/12/10 20:27:45 joris Exp $ */
+/* $OpenBSD: xmalloc.h,v 1.2 2006/03/28 02:13:44 ray Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
@@ -6,7 +6,7 @@
* All rights reserved
* Created: Mon Mar 20 22:09:17 1995 ylo
*
- * Versions of xmalloc and friends that check their results, and never return
+ * Versions of malloc and friends that check their results, and never return
* failure (they call fatal if they encounter an error).
*
* As far as I am concerned, the code I have written for this software
@@ -20,8 +20,12 @@
#define XMALLOC_H
void *xmalloc(size_t);
-void *xrealloc(void *, size_t);
+void *xcalloc(size_t, size_t);
+void *xrealloc(void *, size_t, size_t);
void xfree(void *);
char *xstrdup(const char *);
+int xasprintf(char **, const char *, ...)
+ __attribute__((__format__ (printf, 2, 3)))
+ __attribute__((__nonnull__ (2)));
#endif /* XMALLOC_H */