~sircmpwn/hare-dev

hare: encoding::utf8: validate rune in encoderune() v1 SUPERSEDED

Kirill Primak: 1
 encoding::utf8: validate rune in encoderune()

 1 files changed, 2 insertions(+), 0 deletions(-)
#846487 alpine.yml success
#846488 freebsd.yml success
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/hare-dev/patches/35384/mbox | git am -3
Learn more about email & git

[PATCH hare] encoding::utf8: validate rune in encoderune() Export this patch

Signed-off-by: Kirill Primak <vyivel@eclair.cafe>
---
 encoding/utf8/encode.ha | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/encoding/utf8/encode.ha b/encoding/utf8/encode.ha
index 6de0d4f0..9fecbe72 100644
--- a/encoding/utf8/encode.ha
+++ b/encoding/utf8/encode.ha
@@ -6,6 +6,8 @@
// encoderune.
export fn encoderune(r: rune) []u8 = {
	let ch = r: u32, n = 0z, first = 0u8;
	assert(ch <= 0x10FFFF, "the rune is not a valid Unicode codepoint");

	if (ch < 0x80) {
		first = 0;
		n = 1;
-- 
2.37.3
hare/patches: SUCCESS in 1m51s

[encoding::utf8: validate rune in encoderune()][0] from [Kirill Primak][1]

[0]: https://lists.sr.ht/~sircmpwn/hare-dev/patches/35384
[1]: mailto:vyivel@eclair.cafe

✓ #846488 SUCCESS hare/patches/freebsd.yml https://builds.sr.ht/~sircmpwn/job/846488
✓ #846487 SUCCESS hare/patches/alpine.yml  https://builds.sr.ht/~sircmpwn/job/846487