From 21dc2ec100107660e5a05779481a9c102a11a478 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Sat, 4 Apr 2015 09:55:54 -0400 Subject: [PATCH] UTF8: Moved variable into lower scope --- src/utf8.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/utf8.cpp b/src/utf8.cpp index 881b77ce0..c2a5baccd 100644 --- a/src/utf8.cpp +++ b/src/utf8.cpp @@ -188,20 +188,17 @@ unsigned int utf8_length (const std::string& str) unsigned int utf8_width (const std::string& str) { unsigned int length = 0; - int l; std::string::size_type i = 0; unsigned int c; while ((c = utf8_next_char (str, i))) { - l = mk_wcwidth (c); // Control characters, and more especially newline characters, make // mk_wcwidth() return -1. Ignore that, thereby "adding zero" to length. // Since control characters are not displayed in reports, this is a valid // choice. + int l = mk_wcwidth (c); if (l != -1) - { length += l; - } } return length;