X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fwgtpkg-uninstall.c;h=a89d86382092d9b567c34c45dcbfea2f9ccaec2b;hb=550ca0ae2bb9138c85fda941b67d4db1da1609ed;hp=7516c3f0bf2a480b15d04bce722801e82aeefb6d;hpb=50dd441a11440201e1da9da81a7103677e2282ad;p=src%2Fapp-framework-main.git diff --git a/src/wgtpkg-uninstall.c b/src/wgtpkg-uninstall.c index 7516c3f..a89d863 100644 --- a/src/wgtpkg-uninstall.c +++ b/src/wgtpkg-uninstall.c @@ -1,5 +1,5 @@ /* - Copyright 2015 IoT.bzh + Copyright 2015, 2016, 2017 IoT.bzh author: José Bollo @@ -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;