[tools] sstrip: Was missing include of <byteswap.h>
[openwrt.git] / tools / sstrip / src / sstrip.c
index 6607d12..9d5500d 100644 (file)
@@ -59,6 +59,7 @@
 #include       <unistd.h>
 #include       <fcntl.h>
 #include       <elf.h>
+#include       <byteswap.h>
 
 #ifndef TRUE
 #define        TRUE            1
@@ -251,8 +252,7 @@ static int modifyheaders ## CLASS (Elf ## CLASS ## _Ehdr *ehdr, \
                        ESET(phdr->p_offset,newsize); \
                        ESET(phdr->p_filesz,0); \
                } else if (EGET(phdr->p_offset) + EGET(phdr->p_filesz) > newsize) { \
-                       newsize -= EGET(phdr->p_offset); \
-                       ESET(phdr->p_filesz, newsize); \
+                       ESET(phdr->p_filesz, newsize - EGET(phdr->p_offset)); \
                } \
        } \
  \
This page took 0.020867 seconds and 4 git commands to generate.