Newer
Older
ubixos / src / lib / libc_old / string / strncpy.c
@reddawg reddawg on 15 Apr 2004 230 bytes UbixOS v1.0
#include"string.h"
char*strncpy(char*restrict dst,const char*restrict src,size_t n)
{
	register size_t i=0;
	char*ret=dst;

        do *dst++=*src; while(*src++ && ++i<n);

	if(i<n)
		do *dst++='\0'; while(++i<n);

	return ret;
}