mirror of
https://gitlab.freedesktop.org/libbsd/libbsd.git
synced 2025-01-24 10:59:29 +01:00
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
This commit is contained in:
parent
8e2d55047c
commit
5e0998fa4f
@ -503,7 +503,7 @@ istrsenvisx(char **mbdstp, size_t *dlen, const char *mbsrc, size_t mblength,
|
|||||||
*/
|
*/
|
||||||
for (start = dst; len > 0; len--) {
|
for (start = dst; len > 0; len--) {
|
||||||
c = *src++;
|
c = *src++;
|
||||||
dst = (*f)(dst, c, flags, len >= 1 ? *src : L'\0', extra);
|
dst = (*f)(dst, c, flags, *src, extra);
|
||||||
if (dst == NULL) {
|
if (dst == NULL) {
|
||||||
errno = ENOSPC;
|
errno = ENOSPC;
|
||||||
goto out;
|
goto out;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user