damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

commit e3ca6ca5b47e80f648b7ade896e25b05a8675ddb
parent 494386d2116d4f3a5ae950bcdb19ecacbb84b56e
Author: Rusty Russell <rusty@rustcorp.com.au>
Date:   Sat, 17 Aug 2024 14:57:06 +0930

nostrdb: bolt11: move utf8_check into local function.

It isn't actually in the CCAN module (though it probably should be!).
So it breaks when we update.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: William Casarin <jb55@jb55.com>

Diffstat:
Mnostrdb/ccan/ccan/utf8/utf8.c | 19-------------------
Mnostrdb/ccan/ccan/utf8/utf8.h | 2--
2 files changed, 0 insertions(+), 21 deletions(-)

diff --git a/nostrdb/ccan/ccan/utf8/utf8.c b/nostrdb/ccan/ccan/utf8/utf8.c @@ -178,22 +178,3 @@ size_t utf8_encode(uint32_t point, char dest[UTF8_MAX_LEN]) return 4; } -/* Check for valid UTF-8 */ -bool utf8_check(const void *vbuf, size_t buflen) -{ - const unsigned char *buf = vbuf; - struct utf8_state utf8_state = UTF8_STATE_INIT; - bool need_more = false; - - for (size_t i = 0; i < buflen; i++) { - if (!utf8_decode(&utf8_state, buf[i])) { - need_more = true; - continue; - } - need_more = false; - if (errno != 0) - return false; - } - return !need_more; -} - diff --git a/nostrdb/ccan/ccan/utf8/utf8.h b/nostrdb/ccan/ccan/utf8/utf8.h @@ -52,6 +52,4 @@ bool utf8_decode(struct utf8_state *utf8_state, char c); */ size_t utf8_encode(uint32_t point, char dest[UTF8_MAX_LEN]); -/* Check for valid UTF-8 */ -bool utf8_check(const void *vbuf, size_t buflen); #endif /* CCAN_UTF8_H */