diff options
author | José Bollo <jose.bollo@iot.bzh> | 2016-03-16 16:05:28 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2016-03-16 17:31:58 +0100 |
commit | 2c6fcae14552ab6e7addc82516617a135f86b5ca (patch) | |
tree | e6c8aff7b0fca5ef81c02bfb7c2d71ec6fc97046 /src/afm-db.c | |
parent | abfae2b6d73d7be40ffbff8e8429f71d82df90b5 (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/afm-db.c')
-rw-r--r-- | src/afm-db.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/afm-db.c b/src/afm-db.c index 4dc2d5f..a903be0 100644 --- a/src/afm-db.c +++ b/src/afm-db.c @@ -254,7 +254,8 @@ static int enumentries(struct enumdata *data, int (*callto)(struct enumdata *)) errno = ENAMETOOLONG; return -1; } - data->length = stpcpy(beg, entry.d_name) - data->path; + data->length = (int)(stpcpy(beg, entry.d_name) + - data->path); /* call the function */ rc = callto(data); if (rc) @@ -430,9 +431,9 @@ int afm_db_update_applications(struct afm_db *afdb) /* for each directory of afdb */ for (dir = afdb->dirhead ; dir != NULL ; dir = dir->next) { if (dir->type == type_root) { - edata.length = stpcpy(edata.path, dir->path) - - edata.path; - assert(edata.length < sizeof edata.path); + edata.length = (int)(stpcpy(edata.path, dir->path) + - edata.path); + assert(edata.length < (int)sizeof edata.path); /* enumerate the applications */ rc = enumentries(&edata, enumvers); if (rc) |