utf8: update utf8_is_valid() a bit

Let's avoid a few casts in the function. Also, let's drop the "const"
when returning the string, for similar reasons as strchr() and friends
drop it: so that we don't add a const if the user passes in a non-const
string.
This commit is contained in:
Lennart Poettering
2018-09-25 15:57:47 +02:00
parent 2b5d05fdfe
commit e71fb4b302
2 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
bool unichar_is_valid(char32_t c);
const char *utf8_is_valid(const char *s) _pure_;
char *utf8_is_valid(const char *s) _pure_;
char *ascii_is_valid(const char *s) _pure_;
char *ascii_is_valid_n(const char *str, size_t len);