// Copyright Microsoft and CHERIoT Contributors. | |
// SPDX-License-Identifier: MIT | |
#include <cdefs.h> | |
#include <stddef.h> | |
char *__cheri_libcall strncpy(char *dest, const char *src, size_t n) | |
{ | |
size_t i; | |
for (i = 0; i < n && src[i] != '\0'; i++) | |
dest[i] = src[i]; | |
for (; i < n; i++) | |
dest[i] = '\0'; | |
return dest; | |
} |