summaryrefslogtreecommitdiffstats
path: root/src/wgtpkg-files.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-03-16 16:05:28 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2016-03-16 17:31:58 +0100
commit2c6fcae14552ab6e7addc82516617a135f86b5ca (patch)
treee6c8aff7b0fca5ef81c02bfb7c2d71ec6fc97046 /src/wgtpkg-files.c
parentabfae2b6d73d7be40ffbff8e8429f71d82df90b5 (diff)
cmake: improves error detection
Add detection of problem of cast. The problems are corrected in the patch. Change-Id: I8dc1e987531790860e390dea53ddf49d52339cb2 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/wgtpkg-files.c')
-rw-r--r--src/wgtpkg-files.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/wgtpkg-files.c b/src/wgtpkg-files.c
index cbd6048..46ea047 100644
--- a/src/wgtpkg-files.c
+++ b/src/wgtpkg-files.c
@@ -252,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;
@@ -274,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)))
;