From 54869dcd6c33df99f82cfbe354ff78da8c933d0b Mon Sep 17 00:00:00 2001 From: fef Date: Wed, 14 Jul 2021 16:42:15 +0200 Subject: [PATCH] utf: use correct format specifier --- src/string/utf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/string/utf.c b/src/string/utf.c index 0d67dd5..b372392 100644 --- a/src/string/utf.c +++ b/src/string/utf.c @@ -129,7 +129,7 @@ usize utf8_to_nchr(nchar *dest, const char *restrict utf8chr, error *err) /* Payload bitmask for first byte in the sequence per sequence length */ static const char cmasks[] = { 0x00, 0x7f, 0x1f, 0x0f, 0x07 }; /* Minimum Unicode values per sequence length */ - static const nchar mins[] = { 0xffffffff, 0, 0x80, 0x800, 0x10000 }; + static const nchar mins[] = { 0xffffffff, 0x00, 0x80, 0x800, 0x10000 }; /* Error bitmasks for (unused) bytes 2-4 per sequence length */ static const uint_fast8_t emasks[] = { 0x00, 0x03, 0x07, 0x3f, 0xff }; @@ -196,7 +196,7 @@ usize utf8_to_nchr(nchar *dest, const char *restrict utf8chr, error *err) *dest = '\0'; if ((eflags & 0x01) != 0) { yeet(err, EINVAL, - "Non canonical UTF-8 encoding: %lu byte character stored in %u bytes", + "Non canonical UTF-8 encoding: %zu byte character stored in %u bytes", utf8_nchr_size(c, nil), len); } else if ((eflags & 0x02) != 0) { yeet(err, EINVAL, "Illegal UTF-8 sequence start byte: 0x%02x", utf8chr[0]);