aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--center.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/center.c b/center.c
index 7ac5d69..61193a1 100644
--- a/center.c
+++ b/center.c
@@ -230,8 +230,8 @@ utf8len(const char *s)
{
int l = 0;
- while (*s)
- l += (*s++ & 0xC0) != 0x80;
+ for (; *s; s++)
+ l += *s == '\b' ? -1 : (*s & 0xC0) != 0x80;
if (l > 0 && s[-1] == '\n')
l--;