From 5e0998fa4f0300ec99d0e30c994a500d91cb40c1 Mon Sep 17 00:00:00 2001 From: Guillem Jover Date: Sat, 9 Jun 2018 00:08:14 +0200 Subject: [PATCH] Remove dead code in vis The loop only executes while len > 0, and the trinary operator in the function argument is checking against len >= 1 which will always be true. Warned-by: coverity --- src/vis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vis.c b/src/vis.c index f17d322..674d971 100644 --- a/src/vis.c +++ b/src/vis.c @@ -503,7 +503,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength, */ for (start = dst; len > 0; len--) { c = *src++; - dst = (*f)(dst, c, flags, len >= 1 ? *src : L'\0', extra); + dst = (*f)(dst, c, flags, *src, extra); if (dst == NULL) { errno = ENOSPC; goto out;