The following commit has been merged in the master branch:
commit 9dfb225769bf3fe4c0a9a43d42bc22dbe1d9ffe9
Author: Guillem Jover <[email protected]>
Date:   Fri Dec 2 05:13:59 2011 +0100

    libdpkg: Add new m_calloc()

diff --git a/lib/dpkg/dpkg.h b/lib/dpkg/dpkg.h
index 447c319..89eb4f3 100644
--- a/lib/dpkg/dpkg.h
+++ b/lib/dpkg/dpkg.h
@@ -132,6 +132,7 @@ void cu_closefd(int argc, void **argv);
 
 void setcloexec(int fd, const char* fn);
 void *m_malloc(size_t);
+void *m_calloc(size_t);
 void *m_realloc(void*, size_t);
 char *m_strdup(const char *str);
 char *m_strndup(const char *str, size_t n);
diff --git a/lib/dpkg/libdpkg.Versions b/lib/dpkg/libdpkg.Versions
index 675a1d5..5542909 100644
--- a/lib/dpkg/libdpkg.Versions
+++ b/lib/dpkg/libdpkg.Versions
@@ -47,6 +47,7 @@ LIBDPKG_PRIVATE {
 
        # ‘Must do’ functions
        m_malloc;
+       m_calloc;
        m_realloc;
        m_strdup;
        m_asprintf;
diff --git a/lib/dpkg/mlib.c b/lib/dpkg/mlib.c
index a8ea3a4..9ce0b70 100644
--- a/lib/dpkg/mlib.c
+++ b/lib/dpkg/mlib.c
@@ -57,6 +57,12 @@ void *m_malloc(size_t amount) {
   return r;
 }
 
+void *
+m_calloc(size_t size)
+{
+  return must_alloc(calloc(1, size));
+}
+
 void *m_realloc(void *r, size_t amount) {
   return must_alloc(realloc(r, amount));
 }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to