This repository has been archived on 2021-03-01. You can view files and clone it, but cannot push or open issues or pull requests.
kaneton/kaneton/library/strncpy.c
Mercier Pierre-Olivier fee4dd4e6d Initial snapshot
2013-02-11 22:04:30 +01:00

36 lines
669 B
C

/*
* licence kaneton licence
*
* project kaneton
*
* file /home/buckman/kaneton/libs/klibrary/libstring/strncpy.c
*
* created julien quintard [fri feb 11 02:56:44 2005]
* updated matthieu bucchianeri [tue jan 24 11:56:30 2006]
*/
/*
* ---------- includes --------------------------------------------------------
*/
#include <library/library.h>
/*
* ---------- functions -------------------------------------------------------
*/
char* strncpy(char* to,
char* from,
size_t n)
{
u_int i;
for (i = 0; from[i] && i < n; i++)
to[i] = from[i];
if (i < n)
to[i] = 0;
return (to);
}