diff options
author | Xin LI <delphij@FreeBSD.org> | 2020-03-21 19:13:22 +0000 |
---|---|---|
committer | Xin LI <delphij@FreeBSD.org> | 2020-03-21 19:13:22 +0000 |
commit | b89a9714932b4fb6d8aec10dc79b7ecf9a9ce536 (patch) | |
tree | 02eb67059a2125bda85edbc6e386d53bea49d67e /src/common/tuklib_mbstr_width.c | |
parent | 9657691eff9c78f404f3f9d5907240d267893826 (diff) |
Notes
Diffstat (limited to 'src/common/tuklib_mbstr_width.c')
-rw-r--r-- | src/common/tuklib_mbstr_width.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/common/tuklib_mbstr_width.c b/src/common/tuklib_mbstr_width.c index 3c38990f4608..69d159e0bbcc 100644 --- a/src/common/tuklib_mbstr_width.c +++ b/src/common/tuklib_mbstr_width.c @@ -1,6 +1,6 @@ /////////////////////////////////////////////////////////////////////////////// // -/// \file tuklib_mstr_width.c +/// \file tuklib_mbstr_width.c /// \brief Calculate width of a multibyte string // // Author: Lasse Collin @@ -11,6 +11,7 @@ /////////////////////////////////////////////////////////////////////////////// #include "tuklib_mbstr.h" +#include <string.h> #if defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH) # include <wchar.h> @@ -50,7 +51,7 @@ tuklib_mbstr_width(const char *str, size_t *bytes) if (wc_width < 0) return (size_t)-1; - width += wc_width; + width += (size_t)wc_width; } // Require that the string ends in the initial shift state. |