RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   03-Apr-2009 21:25:37
  Branch: rpm-5_1                          Handle: 2009040319253600

  Modified files:           (Branch: rpm-5_1)
    rpm/build               pack.c

  Log:
    - jbj: rewrite w correct data types to get rid of pugly casts.

  Summary:
    Revision    Changes     Path
    2.291.2.5   +6  -5      rpm/build/pack.c
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/build/pack.c
  ============================================================================
  $ cvs diff -u -r2.291.2.4 -r2.291.2.5 pack.c
  --- rpm/build/pack.c  29 Mar 2009 02:24:21 -0000      2.291.2.4
  +++ rpm/build/pack.c  3 Apr 2009 19:25:36 -0000       2.291.2.5
  @@ -587,6 +587,8 @@
       int addsig = 0;
       int isSource;
       rpmRC rc = RPMRC_OK;
  +    size_t nbr;
  +    size_t nbw;
       int xx;
   
       /* Transfer header reference form *hdrp to h. */
  @@ -880,16 +882,15 @@
       }
        
       /* Write the payload into the package. */
  -    while ((xx = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) {
  -     if (xx <= -1 || Ferror(ifd)) {
  +    while ((nbr = Fread(buf, sizeof(buf[0]), sizeof(buf), ifd)) > 0) {
  +     if (Ferror(ifd)) {
            rpmlog(RPMLOG_ERR, _("Unable to read payload from %s: %s\n"),
                     sigtarget, Fstrerror(ifd));
            rc = RPMRC_FAIL;
            goto exit;
        }
  -     count = (uint32_t) xx;
  -     xx = Fwrite(buf, sizeof(buf[0]), count, fd);
  -     if ((uint32_t)xx != count || Ferror(fd)) {
  +     nbw = Fwrite(buf, sizeof(buf[0]), nbr, fd);
  +     if (nbr != nbw || Ferror(fd)) {
            rpmlog(RPMLOG_ERR, _("Unable to write payload to %s: %s\n"),
                     fileName, Fstrerror(fd));
            rc = RPMRC_FAIL;
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to