This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=b52e6078c112c25dd4d8aec848a617f443db04f5

commit b52e6078c112c25dd4d8aec848a617f443db04f5
Author: Guillem Jover <guil...@debian.org>
AuthorDate: Tue Jan 23 12:32:43 2024 +0100

    dpkg-deb: Rename r variables for fd_read() call chain return value to rc
    
    We are only interested in the return code, and not the amount read,
    so use the slightly more descriptive «rc» name instead if the very
    short and generic «r» one.
    
    Changelog: internal
---
 src/deb/extract.c | 26 +++++++++++++-------------
 1 file changed, 13 insertions(+), 13 deletions(-)

diff --git a/src/deb/extract.c b/src/deb/extract.c
index 48781a318..8b78a7eab 100644
--- a/src/deb/extract.c
+++ b/src/deb/extract.c
@@ -113,7 +113,7 @@ extracthalf(const char *debar, const char *dir,
   char versionbuf[40];
   struct deb_version version;
   off_t ctrllennum, memberlen = 0;
-  ssize_t r;
+  ssize_t rc;
   int dummy;
   pid_t c1=0,c2,c3;
   int p1[2], p2[2];
@@ -126,9 +126,9 @@ extracthalf(const char *debar, const char *dir,
 
   ar = dpkg_ar_open(debar);
 
-  r = read_line(ar->fd, versionbuf, strlen(DPKG_AR_MAGIC), sizeof(versionbuf) 
- 1);
-  if (r <= 0)
-    read_fail(r, debar, _("archive magic version number"));
+  rc = read_line(ar->fd, versionbuf, strlen(DPKG_AR_MAGIC), sizeof(versionbuf) 
- 1);
+  if (rc <= 0)
+    read_fail(rc, debar, _("archive magic version number"));
 
   if (strcmp(versionbuf, DPKG_AR_MAGIC) == 0) {
     int adminmember = -1;
@@ -138,9 +138,9 @@ extracthalf(const char *debar, const char *dir,
     for (;;) {
       struct dpkg_ar_hdr arh;
 
-      r = fd_read(ar->fd, &arh, sizeof(arh));
-      if (r != sizeof(arh))
-        read_fail(r, debar, _("archive member header"));
+      rc = fd_read(ar->fd, &arh, sizeof(arh));
+      if (rc != sizeof(arh))
+        read_fail(rc, debar, _("archive member header"));
 
       if (dpkg_ar_member_is_illegal(&arh))
         ohshit(_("file '%.250s' is corrupt - bad archive header magic"), 
debar);
@@ -155,9 +155,9 @@ extracthalf(const char *debar, const char *dir,
           ohshit(_("file '%.250s' is not a Debian binary archive (try 
dpkg-split?)"),
                  debar);
         infobuf= m_malloc(memberlen+1);
-        r = fd_read(ar->fd, infobuf, memberlen + (memberlen & 1));
-        if (r != (memberlen + (memberlen & 1)))
-          read_fail(r, debar, _("archive information header member"));
+        rc = fd_read(ar->fd, infobuf, memberlen + (memberlen & 1));
+        if (rc != (memberlen + (memberlen & 1)))
+          read_fail(rc, debar, _("archive information header member"));
         infobuf[memberlen] = '\0';
 
         if (strchr(infobuf, '\n') == NULL)
@@ -245,9 +245,9 @@ extracthalf(const char *debar, const char *dir,
     if (errstr)
       ohshit(_("archive has invalid format version: %s"), errstr);
 
-    r = read_line(ar->fd, ctrllenbuf, 1, sizeof(ctrllenbuf) - 1);
-    if (r <= 0)
-      read_fail(r, debar, _("archive control member size"));
+    rc = read_line(ar->fd, ctrllenbuf, 1, sizeof(ctrllenbuf) - 1);
+    if (rc <= 0)
+      read_fail(rc, debar, _("archive control member size"));
     if (sscanf(ctrllenbuf, "%jd%c%d", (intmax_t *)&ctrllennum, &nlc, &dummy) 
!= 2 ||
         nlc != '\n')
       ohshit(_("archive has malformed control member size '%s'"), ctrllenbuf);

-- 
Dpkg.Org's dpkg

Reply via email to