summaryrefslogtreecommitdiff
path: root/lib/uniwidth/u32-width.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
committerJörg Frings-Fürst <debian@jff.email>2026-03-08 17:28:33 +0100
commit5f59a34ab747dde8ede7357f3431bf06bd6002fe (patch)
tree056a4477fd870d454d5be5868cddab829a47f4d2 /lib/uniwidth/u32-width.c
parent27dae84ed92f1ef0300263091972338d12e78348 (diff)
New upstream version 1.4.2upstream/1.4.2upstream
Diffstat (limited to 'lib/uniwidth/u32-width.c')
-rw-r--r--lib/uniwidth/u32-width.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/uniwidth/u32-width.c b/lib/uniwidth/u32-width.c
index bb4c04a8..42e343d4 100644
--- a/lib/uniwidth/u32-width.c
+++ b/lib/uniwidth/u32-width.c
@@ -1,5 +1,5 @@
/* Determine display width of UTF-32 string.
- Copyright (C) 2001-2002, 2006, 2009-2025 Free Software Foundation, Inc.
+ Copyright (C) 2001-2002, 2006, 2009-2026 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2002.
This file is free software.
@@ -37,12 +37,11 @@ u32_width (const uint32_t *s, size_t n, const char *encoding)
while (s < s_end)
{
ucs4_t uc = *s++;
- int w;
if (uc == 0)
break; /* end of string reached */
- w = uc_width (uc, encoding);
+ int w = uc_width (uc, encoding);
if (w >= 0) /* ignore control characters in the string */
width += w;
}