X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-files.c;h=cce6a04b9a0608f47b306e1ab2da87cf073cd0fd;hb=0c6c12370b8f2b467f64e08b96b21b20e7ee15ee;hp=bb758e0ad6bb643b0d1596f4e1fab9cee8bfdec9;hpb=41e3ea4dbae634ca13941d134e990d953b741c4b;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-files.c b/src/wgtpkg-files.c index bb758e0..cce6a04 100644 --- a/src/wgtpkg-files.c +++ b/src/wgtpkg-files.c @@ -1,5 +1,7 @@ /* - Copyright 2015 IoT.bzh + Copyright 2015, 2016, 2017 IoT.bzh + + author: José Bollo Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -22,9 +24,11 @@ #include #include #include +#include #include "verbose.h" -#include "wgtpkg.h" +#include "wgtpkg-workdir.h" +#include "wgtpkg-files.h" struct fdb { unsigned int count; @@ -46,7 +50,7 @@ static unsigned int what_signature(const char *name) return UINT_MAX; len = sizeof(distributor_file_prefix)-1; - if (memcmp(name, distributor_file_prefix, len)) + if (strncmp(name, distributor_file_prefix, len)) return 0; if (name[len] <= '0' || name[len] > '9') return 0; @@ -248,9 +252,10 @@ void file_clear_flags() allfiles.files[i]->flags &= flag_signature; } -static int fill_files_rec(char name[PATH_MAX], int offset) +static int fill_files_rec(char name[PATH_MAX], unsigned offset) { - int len, err, fd; + int err, fd; + unsigned len; DIR *dir; struct dirent *ent; @@ -270,7 +275,7 @@ static int fill_files_rec(char name[PATH_MAX], int offset) ent = readdir(dir); while (ent != NULL) { - len = strlen(ent->d_name); + len = (unsigned)strlen(ent->d_name); if (ent->d_name[0] == '.' && (len == 1 || (ent->d_name[1] == '.' && len == 2))) ;