The following commit has been merged in the master branch:
commit 194dce1ca37ab0047c0e0606c7e9ba80196d3d2c
Author: Guillem Jover <[email protected]>
Date:   Fri Feb 4 19:22:05 2011 +0100

    dpkg: Remove temporary variable admindirlen in process_archive()
    
    Inline the strlen() call instead of using the intermediate variable.

diff --git a/src/processarc.c b/src/processarc.c
index e7a9047..a62ced6 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -178,7 +178,7 @@ void process_archive(const char *filename) {
   static struct varbuf infofnvb, fnvb, depprobwhy;
   static struct tarcontext tc;
 
-  int r, admindirlen, i, infodirlen, infodirbaseused;
+  int r, i, infodirlen, infodirbaseused;
   pid_t pid;
   struct pkgiterator *it;
   struct pkginfo *pkg, *otherpkg, *divpkg;
@@ -202,7 +202,6 @@ void process_archive(const char *filename) {
   struct rename_list *rename_head = NULL, *rename_node = NULL;
 
   cleanup_pkg_failed= cleanup_conflictor_failed= 0;
-  admindirlen= strlen(admindir);
 
   pfilename = summarize_filename(filename);
 
@@ -238,7 +237,8 @@ void process_archive(const char *filename) {
     /* We want it to be on the same filesystem so that we can
      * use rename(2) to install the postinst &c. */
     if (!cidirbuf)
-      cidirbuf= 
m_malloc(admindirlen+sizeof(CONTROLDIRTMP)+MAXCONTROLFILENAME+10);
+      cidirbuf = m_malloc(strlen(admindir) + sizeof(CONTROLDIRTMP) +
+                          MAXCONTROLFILENAME + 10);
     cidir= cidirbuf;
     strcpy(cidir,admindir);
     strcat(cidir, "/" CONTROLDIRTMP);

-- 
dpkg's main repository


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

Reply via email to