From 03b67742f6e3939ceae5f9587c60391d35259f6d Mon Sep 17 00:00:00 2001 From: Wynn Wolf Arbor Date: Wed, 18 Mar 2020 19:47:57 +0100 Subject: Fix several sign-compare warnings --- kbfunc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'kbfunc.c') diff --git a/kbfunc.c b/kbfunc.c index c68aa8c..a58a9ac 100644 --- a/kbfunc.c +++ b/kbfunc.c @@ -626,7 +626,9 @@ kbfunc_menu_exec(void *ctx, struct cargs *cargs) (void)memset(tpath, '\0', sizeof(tpath)); l = snprintf(tpath, sizeof(tpath), "%s/%s", paths[i], dp->d_name); - if (l == -1 || l >= sizeof(tpath)) + if (l < 0) + continue; + if ((unsigned)l >= sizeof(tpath)) continue; /* Skip everything but regular files and symlinks. */ if (dp->d_type != DT_REG && dp->d_type != DT_LNK) { -- cgit v1.2.3-2-gb3c3