The following commit has been merged in the master branch:
commit 71e99e00040e076a127347bc95b63260da5967c8
Author: Guillem Jover <[email protected]>
Date:   Fri Dec 2 05:17:07 2011 +0100

    dpkg-query: Use m_calloc() instead of m_malloc() + memset()

diff --git a/src/querycmd.c b/src/querycmd.c
index 17f1319..5086017 100644
--- a/src/querycmd.c
+++ b/src/querycmd.c
@@ -225,8 +225,7 @@ listpackages(const char *const *argv)
     int argc, ip, *found;
 
     for (argc = 0; argv[argc]; argc++);
-    found = m_malloc(sizeof(int) * argc);
-    memset(found, 0, sizeof(int) * argc);
+    found = m_calloc(sizeof(int) * argc);
 
     for (i = 0; i < array.n_pkgs; i++) {
       pkg = array.pkgs[i];
@@ -493,8 +492,7 @@ showpackages(const char *const *argv)
     int argc, ip, *found;
 
     for (argc = 0; argv[argc]; argc++);
-    found = m_malloc(sizeof(int) * argc);
-    memset(found, 0, sizeof(int) * argc);
+    found = m_calloc(sizeof(int) * argc);
 
     for (i = 0; i < array.n_pkgs; i++) {
       pkg = array.pkgs[i];

-- 
dpkg's main repository


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

Reply via email to