From 97f86af4e914496d2e728df0186881476f2916b1 Mon Sep 17 00:00:00 2001 From: Sipke Vriend Date: Tue, 1 Oct 2019 13:56:51 +1000 Subject: [PATCH] lfs_remove: Cast tag/error return codes to int. For correctness, cast the lfs_stag_t variables to int when returning a negative error code. --- lfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lfs.c b/lfs.c index d1d5435..046af95 100644 --- a/lfs.c +++ b/lfs.c @@ -3097,7 +3097,7 @@ int lfs_remove(lfs_t *lfs, const char *path) { lfs_stag_t tag = lfs_dir_find(lfs, &cwd, &path, NULL); if (tag < 0 || lfs_tag_id(tag) == 0x3ff) { LFS_TRACE("lfs_remove -> %d", (tag < 0) ? tag : LFS_ERR_INVAL); - return (tag < 0) ? tag : LFS_ERR_INVAL; + return (tag < 0) ? (int)tag : LFS_ERR_INVAL; } lfs_mdir_t dir; @@ -3108,7 +3108,7 @@ int lfs_remove(lfs_t *lfs, const char *path) { LFS_MKTAG(LFS_TYPE_STRUCT, lfs_tag_id(tag), 8), pair); if (res < 0) { LFS_TRACE("lfs_remove -> %d", res); - return res; + return (int)res; } lfs_pair_fromle32(pair);