fix: Use memcpy() in minitar_strlcpy()
This allows the platform to provide a more optimized and FAST version of memcpy than our manual implementation inside strlcpy.
This commit is contained in:
parent
56250a226f
commit
4c90f9078b
@ -45,7 +45,7 @@ static size_t minitar_strlcpy(char* dest, const char* src, size_t size)
|
||||
len = full_len = strlen(src);
|
||||
if (size == 0) return len;
|
||||
if (len > (size - 1)) len = size - 1;
|
||||
for (size_t i = 0; i < len; ++i) { *(dest + i) = *(src + i); }
|
||||
memcpy(dest, src, len);
|
||||
dest[len] = 0; // null-terminate
|
||||
return full_len;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user