aboutsummaryrefslogtreecommitdiff
path: root/util.h
diff options
context:
space:
mode:
authorDaniel Eklöf <daniel@ekloef.se>2020-08-20 17:25:35 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-06-24 15:30:45 +0000
commitb9ef703eb14ba2357b847b62a715b4e97f690209 (patch)
treec6e65e05499e292a4f51d09453f44d1bdf0f93ad /util.h
parentMerge branch 'sixel-heap-user-after-free-after-blending' (diff)
wip: grapheme shaping
Diffstat (limited to 'util.h')
-rw-r--r--util.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/util.h b/util.h
index aa9fc8ba..af215111 100644
--- a/util.h
+++ b/util.h
@@ -35,3 +35,11 @@ sdbm_hash(const char *s)
return hash;
}
+
+#include <wchar.h>
+static inline int
+my_wcswidth(const wchar_t *s, size_t n)
+{
+ int ret = wcswidth(s, n);
+ return max(0, ret);
+}