mirror of
				https://github.com/GrapheneOS/hardened_malloc.git
				synced 2025-10-26 14:16:33 +01:00 
			
		
		
		
	Signed-off-by: Tavi <tavi@divested.dev> Co-authored-by: =?UTF-8?q?Christian=20G=C3=B6ttsche?= <cgzones@googlemail.com>
		
			
				
	
	
		
			17 lines
		
	
	
	
		
			361 B
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
	
		
			361 B
		
	
	
	
		
			C
		
	
	
	
	
	
| #include "musl.h"
 | |
| 
 | |
| /* Copied from musl libc version 1.2.5 licensed under the MIT license */
 | |
| 
 | |
| #include <wchar.h>
 | |
| #include <stdint.h>
 | |
| 
 | |
| wchar_t *musl_wmemmove(wchar_t *d, const wchar_t *s, size_t n)
 | |
| {
 | |
| 	wchar_t *d0 = d;
 | |
| 	if (d == s) return d;
 | |
| 	if ((uintptr_t)d-(uintptr_t)s < n * sizeof *d)
 | |
| 		while (n--) d[n] = s[n];
 | |
| 	else
 | |
| 		while (n--) *d++ = *s++;
 | |
| 	return d0;
 | |
| }
 |