Newer
Older
UbixOS / Dump / hybos / lib / string / strncpy.c
@cwolsen cwolsen on 31 Oct 2018 328 bytes Big Dump
#include <string.h> /* size_t */

char *strncpy(char * dest, const char * source, size_t count)
{
	char *start = dest;

	while(count && (*dest++ = *source++))    /* copy string */
		count--;

	if(count)                              /* pad out with zeroes */
		while(--count)
			*dest++ = '\0';

	return(start);
}