aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-02-05 10:39:32 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-02-05 10:39:32 +0100
commit7d6a4222f3c4fda1ea2d69ae057ba7cc31343ffe (patch)
tree1aa62fb647277a4e3772ee15e5bdf7b3232f7156
parent50dd441a11440201e1da9da81a7103677e2282ad (diff)
wgtpkg-zip: fix bug when file's size is zero
Change-Id: Id0b58a81f4ec73d21aface1a7da9da897fc5eea9 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/wgtpkg-zip.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/src/wgtpkg-zip.c b/src/wgtpkg-zip.c
index 916d0cd..8fe17c4 100644
--- a/src/wgtpkg-zip.c
+++ b/src/wgtpkg-zip.c
@@ -150,20 +150,10 @@ int zread(const char *zipfile, unsigned long long maxsize)
ERROR("empty entry found in %s", zipfile);
goto error;
}
- if (zstat.size == 0) {
- /* directory name */
- if (zstat.name[len - 1] != '/') {
- ERROR("bad directory name %s in %s", zstat.name, zipfile);
- goto error;
- }
+ if (zstat.name[len - 1] == '/')
/* record */
fdesc = file_add_directory(zstat.name);
- } else {
- /* directory name */
- if (zstat.name[len - 1] == '/') {
- ERROR("bad file name %s in %s", zstat.name, zipfile);
- goto error;
- }
+ else {
/* get the size */
esize += zstat.size;
/* record */