fwtool: do not strip metadata if extracting signature
[openwrt/openwrt.git] / package / system / fwtool / src / fwtool.c
index e77b8b5..505fafc 100644 (file)
@@ -347,8 +347,10 @@ extract_data(const char *name)
                        ret = 0;
                        break;
                } else if (tr.type == FWIMAGE_INFO) {
                        ret = 0;
                        break;
                } else if (tr.type == FWIMAGE_INFO) {
-                       if (!metadata_file)
+                       if (!metadata_file) {
+                               dbuf.file_len += data_len + sizeof(tr);
                                break;
                                break;
+                       }
 
                        hdr = buf;
                        data_len -= sizeof(*hdr);
 
                        hdr = buf;
                        data_len -= sizeof(*hdr);