aboutsummaryrefslogtreecommitdiffstats
path: root/libcharconv_tags.c
diff options
context:
space:
mode:
Diffstat (limited to 'libcharconv_tags.c')
-rw-r--r--libcharconv_tags.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/libcharconv_tags.c b/libcharconv_tags.c
index 326a83e..d069c76 100644
--- a/libcharconv_tags.c
+++ b/libcharconv_tags.c
@@ -7,13 +7,8 @@ libcharconv_tags(const char *s, size_t slen, size_t *n, uint_least32_t *cp, size
{
uint_least32_t c;
*n = 0;
- for (; slen--; s++) {
- if ('\x20' <= *s && *s <= '\x7E') {
- c = (uint_least32_t)(UINT32_C(0xE0000) + (unsigned)*s);
- goto conv;
- } else {
- *n += 1u;
- }
+ for (; slen--; s++, ++*n) {
+ PLAIN_RANGE('\x20', '\x7E', 0xE0020);
}
no_conv:
return LIBCHARCONV_NO_CONVERT;