diff options
| author | Thomas Voss <mail@thomasvoss.com> | 2024-01-27 23:26:42 +0100 | 
|---|---|---|
| committer | Thomas Voss <mail@thomasvoss.com> | 2024-01-27 23:26:42 +0100 | 
| commit | 679f7928e27a95e559eb3a69febf0c6336e40234 (patch) | |
| tree | af9c5bb35253086eb8e3ad3d7774e7349b3beefe /vendor/librune/lib/utf8/u8next.c | |
| parent | fd502fd87b40ae7f60314d8d9009f739f1c5fcf3 (diff) | |
Bump librune
Diffstat (limited to 'vendor/librune/lib/utf8/u8next.c')
| -rw-r--r-- | vendor/librune/lib/utf8/u8next.c | 18 | 
1 files changed, 10 insertions, 8 deletions
| diff --git a/vendor/librune/lib/utf8/u8next.c b/vendor/librune/lib/utf8/u8next.c index 8edc084..12c521d 100644 --- a/vendor/librune/lib/utf8/u8next.c +++ b/vendor/librune/lib/utf8/u8next.c @@ -1,14 +1,16 @@ +#define _RUNE_NO_MACRO_WRAPPER 1  #include "utf8.h" -#include "internal/common.h" - -const char8_t * +int  u8next(rune *ch, const char8_t **s, size_t *n)  { -	int m; +	int m = 0; + +	if (*n) { +		m = u8tor_uc(ch, *s); +		*n -= m; +		*s += m; +	} -	if (*n == 0) -		return nullptr; -	*n -= m = u8tor_uc(ch, *s); -	return *s += m; +	return m;  } |