strcpy.3: Formatting fixes in strncpy() example implementation code

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Michael Kerrisk 2010-10-11 08:09:07 +02:00
parent 01e16c8aa9
commit 83e5bed5a5
1 changed files with 5 additions and 4 deletions

View File

@ -74,13 +74,14 @@ might be:
.in +4n
.nf
char*
strncpy(char *dest, const char *src, size_t n){
char *
strncpy(char *dest, const char *src, size_t n)
{
size_t i;
for (i = 0 ; i < n && src[i] != \(aq\\0\(aq ; i++)
for (i = 0; i < n && src[i] != \(aq\\0\(aq; i++)
dest[i] = src[i];
for ( ; i < n ; i++)
for ( ; i < n; i++)
dest[i] = \(aq\\0\(aq;
return dest;