]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
skipcpio: limit the local var scope
authorHarald Hoyer <harald@redhat.com>
Fri, 29 Aug 2014 11:22:37 +0000 (13:22 +0200)
committerHarald Hoyer <harald@redhat.com>
Fri, 29 Aug 2014 11:26:32 +0000 (13:26 +0200)
skipcpio/skipcpio.c

index ac0578ea54be01ab2a9b150d77bbde46b9151520..311a2e5914379d875351ab4dbc7e93b67fca7f95 100644 (file)
@@ -40,7 +40,6 @@ int main(int argc, char **argv)
 {
         FILE *f;
         size_t s;
-        long pos = 0;
 
         if (argc != 2) {
                 fprintf(stderr, "Usage: %s <file>\n", argv[0]);
@@ -65,6 +64,7 @@ int main(int argc, char **argv)
         /* check, if this is a cpio archive */
         if ((buf[0] == 0x71 && buf[1] == 0xc7)
             || (buf[0] == '0' && buf[1] == '7' && buf[2] == '0' && buf[3] == '7' && buf[4] == '0' && buf[5] == '1')) {
+                long pos = 0;
 
                 /* Search for CPIO_END */
                 do {