]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd-utils: introduce xzalloc() helper
authorMike Frysinger <vapier@gentoo.org>
Fri, 1 Oct 2010 05:38:48 +0000 (01:38 -0400)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Fri, 1 Oct 2010 06:29:44 +0000 (09:29 +0300)
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
include/xalloc.h

index d49a1ae48a44633912a00e0c5693e9a03a6f0f3a..35a94afc20040fc5450a89bf43870775d7f0a4c4 100644 (file)
@@ -55,6 +55,12 @@ static void *xcalloc(size_t nmemb, size_t size)
        return ptr;
 }
 
+__attribute__((unused))
+static void *xzalloc(size_t size)
+{
+       return xcalloc(1, size);
+}
+
 __attribute__((unused))
 static void *xrealloc(void *ptr, size_t size)
 {