aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-04-27 21:07:30 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-04-27 21:07:30 +0200
commitfddce452aef5c7371e138efedfbc1a460aa70f23 (patch)
treee26a3c9717c86390c2ad7145db07c1df385f33f0
parentebe5de98275f9c512d32d8163005f17ce0ee8dd9 (diff)
Fix broken things (_Generic() sucks ass)
-rw-r--r--include/mbstring.h2
-rw-r--r--man/u8len.32
2 files changed, 2 insertions, 2 deletions
diff --git a/include/mbstring.h b/include/mbstring.h
index 04af4fd..e487da5 100644
--- a/include/mbstring.h
+++ b/include/mbstring.h
@@ -11,7 +11,7 @@
#define U8(s) \
_Generic((s), \
nullptr_t: ((struct u8view){}), \
- default: ((struct u8view){.p = (u8##s), .len = sizeof(s) - 1}))
+ default: ((struct u8view){.p = (s), .len = sizeof(s) - 1}))
#define U8_ARGS(s) ((s).p), ((s).len)
#define U8_ARGSP(s) (&(s).p), (&(s).len)
diff --git a/man/u8len.3 b/man/u8len.3
index 75dc668..f4d152f 100644
--- a/man/u8len.3
+++ b/man/u8len.3
@@ -34,7 +34,7 @@ will return 17 while the call to
will return 22 as a result of use of multibyte-characters in
.Fa s .
.Bd -literal -offset indent
-struct u8view sv = U8(\(dq„Der Große Duden“\(dq);
+struct u8view sv = U8(u8\(dq„Der Große Duden“\(dq);
size_t blen = strlen((char *)sv.p);
size_t cplen = u8len(U8_ARGS(sv));
.Ed