From fc575f6986d19205a3b97f1813246529c6d2fc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 5 Oct 2016 22:06:06 +0200 Subject: Fix various issues reported by coverity scan --- text-util.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'text-util.c') diff --git a/text-util.c b/text-util.c index c7a1349..f3ba0a0 100644 --- a/text-util.c +++ b/text-util.c @@ -84,7 +84,6 @@ int text_string_width(const char *data, size_t len) { const char *s = data; while (len > 0) { - char buf[MB_CUR_MAX]; wchar_t wc; size_t wclen = mbrtowc(&wc, s, len, &ps); if (wclen == (size_t)-1 && errno == EILSEQ) { @@ -98,7 +97,7 @@ int text_string_width(const char *data, size_t len) { /* assume NUL byte will be displayed as ^@ */ width += 2; wclen = 1; - } else if (buf[0] == '\t') { + } else if (wc == L'\t') { width++; wclen = 1; } else { -- cgit v1.2.3