aboutsummaryrefslogtreecommitdiff
path: root/sys/libunicode/canfit.c
diff options
context:
space:
mode:
authorNicholas <nbnoll@eml.cc>2021-11-10 20:12:45 -0800
committerNicholas <nbnoll@eml.cc>2021-11-10 20:12:45 -0800
commitb5de2d7bd1e08d27f7780434e601d6d3a0750583 (patch)
tree1d12af8a2c5903f1eef3b967e52474a244e78257 /sys/libunicode/canfit.c
parent0a1041044141ddbda0c67602e70fe8894e7430fd (diff)
chore: libunicode -> libutf
Diffstat (limited to 'sys/libunicode/canfit.c')
-rw-r--r--sys/libunicode/canfit.c23
1 files changed, 0 insertions, 23 deletions
diff --git a/sys/libunicode/canfit.c b/sys/libunicode/canfit.c
deleted file mode 100644
index 4579ab3..0000000
--- a/sys/libunicode/canfit.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include "internal.h"
-
-/* returns 1 if string of length n is long enough to be decoded */
-int
-utf8·canfit(byte* s, int n)
-{
- int i;
- rune c;
-
- if(n <= 0)
- return 0;
-
- c = *(ubyte*)s;
- if(c < TByte1)
- return 1;
-
- if(c < TByte3)
- return n >= 2;
- if(c < TByte4)
- return n >= 3;
-
- return n >= UTFmax;
-}