aboutsummaryrefslogtreecommitdiffstats
path: root/src/wgtpkg-uninstall.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-uninstall.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-uninstall.c')
-rw-r--r--src/wgtpkg-uninstall.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wgtpkg-uninstall.c b/src/wgtpkg-uninstall.c
index 7516c3f..1d4e0df 100644
--- a/src/wgtpkg-uninstall.c
+++ b/src/wgtpkg-uninstall.c
@@ -47,12 +47,12 @@ int uninstall_widget(const char *idaver, const char *root)
errno = EINVAL;
return -1;
}
- id = strndupa(idaver, at - idaver);
+ id = strndupa(idaver, (size_t)(at - idaver));
ver = strdupa(at + 1);
/* compute the path */
rc = snprintf(path, sizeof path, "%s/%s/%s", root, id, ver);
- if (rc >= sizeof path) {
+ if (rc >= (int)sizeof path) {
ERROR("bad widget id '%s', too long", idaver);
errno = EINVAL;
return -1;
@@ -67,14 +67,14 @@ int uninstall_widget(const char *idaver, const char *root)
/* removes the icon of the application */
rc = snprintf(path, sizeof path, "%s/%s", FWK_ICON_DIR, idaver);
- assert(rc < sizeof path);
+ assert(rc < (int)sizeof path);
rc = unlink(path);
if (rc < 0)
ERROR("can't removing '%s': %m", path);
/* removes the parent directory if empty */
rc2 = snprintf(path, sizeof path, "%s/%s", root, id);
- assert(rc2 < sizeof path);
+ assert(rc2 < (int)sizeof path);
rc2 = rmdir(path);
if (rc < 0 && errno == ENOTEMPTY)
return rc;