ti83-sdk/lib83/strncpy.c

11 lines
181 B
C
Raw Normal View History

2023-10-08 16:20:19 +00:00
#include <string.h>
char * strncpy(char * d, const char * s, size_t n) {
register char * d1 = d;
while (n && *s) { n--; *d++ = *s++; }
while (n--) *d++ = '\0' ;
return d1;
}