aboutsummaryrefslogtreecommitdiff
path: root/center.c
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2022-09-23 21:03:36 +0200
committerThomas Voss <mail@thomasvoss.com> 2022-09-23 21:03:36 +0200
commit7f2c78bc7becb19fb0e13eba279a65a647683089 (patch)
treeaff2ee303139d5c25ff8ce7535053cbaee744fc1 /center.c
parent16f37ff056aa29f22e2b288d202867663e165486 (diff)
Fix centering with ANSI escapes
This was broken with the logic change in #68f7fb9 I think. At the very least it’s that commit after which I noticed this bug. Doesn’t matter though, it’s fixed now.
Diffstat (limited to 'center.c')
-rw-r--r--center.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/center.c b/center.c
index be6d9ee..10e8130 100644
--- a/center.c
+++ b/center.c
@@ -165,7 +165,7 @@ noesclen(const char *s)
while ((d = strchr(d, ESC)) != NULL)
off += matchesc(++d);
- return utf8len(s) + off;
+ return utf8len(s) - off;
}
/* Return the length of the ANSI color escape sequence at the beginning of the string `s'. If no