repo.or.cz
/
haiku.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
vfs: check userland buffers before reading them.
[haiku.git]
/
src
/
system
/
libroot
/
posix
/
string
/
strncat.c
blob
ae4b757fb92f507e897f05a23c49dddb982d1ff5
1
/*
2
** Copyright 2001, Travis Geiselbrecht. All rights reserved.
3
** Distributed under the terms of the NewOS License.
4
*/
5
6
#include <sys/types.h>
7
#include <string.h>
8
9
10
char
*
11
strncat
(
char
*
dest
,
char const
*
src
,
size_t
count
)
12
{
13
char
*
tmp
=
dest
;
14
15
if
(
count
>
0
) {
16
while
(*
dest
)
17
dest
++;
18
while
((*
dest
++ = *
src
++)) {
19
if
(--
count
==
0
) {
20
*
dest
=
'\0'
;
21
break
;
22
}
23
}
24
}
25
26
return
tmp
;
27
}
28