The following commit has been merged in the master branch:
commit 1ccfc48ad31eb564360dc2f2b8175bd777776f70
Author: Guillem Jover <[EMAIL PROTECTED]>
Date:   Tue Aug 5 06:59:47 2008 +0300

    libdpkg: Use sizeof_array instead of ad-hoc calculation

diff --git a/ChangeLog b/ChangeLog
index 5e922f7..6821015 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2008-08-05  Guillem Jover  <[EMAIL PROTECTED]>
 
+       * lib/ehandle.c: Include <dpkg-priv.h>.
+       (push_cleanup): Use sizeof_array instead of ad-hoc calculation.
+
+2008-08-05  Guillem Jover  <[EMAIL PROTECTED]>
+
        * scripts/dpkg-scanpackages.pl: Use usageerr instead of embedded code.
 
 2008-08-05  Guillem Jover  <[EMAIL PROTECTED]>
diff --git a/lib/ehandle.c b/lib/ehandle.c
index a4665b4..883f325 100644
--- a/lib/ehandle.c
+++ b/lib/ehandle.c
@@ -30,6 +30,7 @@
 
 #include <dpkg.h>
 #include <dpkg-db.h>
+#include <dpkg-priv.h>
 
 static const char *errmsg; /* points to errmsgbuf or malloc'd */
 static char errmsgbuf[4096];
@@ -188,7 +189,7 @@ void push_cleanup(void (*call1)(int argc, void **argv), int 
mask1,
   
   cep= malloc(sizeof(struct cleanupentry) + sizeof(char*)*(nargs+1));
   if (!cep) {
-    if (nargs > sizeof(emergency.args)/sizeof(void*))
+    if (nargs > sizeof_array(emergency.args))
       ohshite(_("out of memory for new cleanup entry with many arguments"));
     e= errno; cep= &emergency.ce;
   }

-- 
dpkg's main repository


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

Reply via email to