r161 - trunk

Petter Reinholdtsen pere at moszumanska.debian.org
Sun Jan 12 07:14:37 UTC 2014


Author: pere
Date: 2014-01-12 07:14:37 +0000 (Sun, 12 Jan 2014)
New Revision: 161

Modified:
   trunk/chrpath.c
   trunk/killrpath.c
Log:
Compare the return value from read() using (ssize_t), not (int).

Modified: trunk/chrpath.c
===================================================================
--- trunk/chrpath.c	2014-01-12 07:04:06 UTC (rev 160)
+++ trunk/chrpath.c	2014-01-12 07:14:37 UTC (rev 161)
@@ -102,7 +102,7 @@
     }
   memset(dyns, 0, PHDR(p_filesz));
   if (lseek(fd, PHDR(p_offset), SEEK_SET) == -1
-      || read(fd, dyns, PHDR(p_filesz)) != (int)PHDR(p_filesz))
+      || read(fd, dyns, PHDR(p_filesz)) != (ssize_t)PHDR(p_filesz))
     {
       perror ("reading dynamic section");
       free(dyns);
@@ -174,7 +174,7 @@
     elf_close(fd);
     return 1;
   }
-  if (read(fd, strtab, SHDR_O(sh_size)) != (int)SHDR_O(sh_size))
+  if (read(fd, strtab, SHDR_O(sh_size)) != (ssize_t)SHDR_O(sh_size))
   {
     perror ("reading string table");
     free(strtab);

Modified: trunk/killrpath.c
===================================================================
--- trunk/killrpath.c	2014-01-12 07:04:06 UTC (rev 160)
+++ trunk/killrpath.c	2014-01-12 07:14:37 UTC (rev 161)
@@ -62,7 +62,7 @@
      }
    memset(dyns, 0, PHDR(p_memsz));
    if (lseek(fd, PHDR(p_offset), SEEK_SET) == -1
-       || read(fd, dyns, PHDR(p_filesz)) != (int)PHDR(p_filesz))
+       || read(fd, dyns, PHDR(p_filesz)) != (ssize_t)PHDR(p_filesz))
      {
        perror ("reading dynamic section");
        free(dyns);




More information about the Chrpath-commits mailing list