Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam
2026-02-26 10:18:15 +00:00
12 changed files with 541 additions and 336 deletions

10
utf8.c
View File

@@ -652,7 +652,7 @@ utf8_append(struct utf8_data *ud, u_char ch)
* bytes available for each character from src (for \abc or UTF-8) plus space
* for \0.
*/
int
size_t
utf8_strvis(char *dst, const char *src, size_t len, int flag)
{
struct utf8_data ud;
@@ -690,11 +690,11 @@ utf8_strvis(char *dst, const char *src, size_t len, int flag)
}
/* Same as utf8_strvis but allocate the buffer. */
int
size_t
utf8_stravis(char **dst, const char *src, int flag)
{
char *buf;
int len;
size_t len;
buf = xreallocarray(NULL, 4, strlen(src) + 1);
len = utf8_strvis(buf, src, strlen(src), flag);
@@ -704,11 +704,11 @@ utf8_stravis(char **dst, const char *src, int flag)
}
/* Same as utf8_strvis but allocate the buffer. */
int
size_t
utf8_stravisx(char **dst, const char *src, size_t srclen, int flag)
{
char *buf;
int len;
size_t len;
buf = xreallocarray(NULL, 4, srclen + 1);
len = utf8_strvis(buf, src, srclen, flag);