repo.or.cz
/
git
/
mingw
/
4msysgit
/
wingit-dll.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
receive-pack: do not insist on fast-forward outside refs/heads/
[git/mingw/4msysgit/wingit-dll.git]
/
compat
/
strlcpy.c
blob
b66856a3a50a93262ee4b5bd0294bb0c7fc85b15
1
#include <string.h>
2
3
size_t
gitstrlcpy
(
char
*
dest
,
const char
*
src
,
size_t
size
)
4
{
5
size_t
ret
=
strlen
(
src
);
6
7
if
(
size
) {
8
size_t
len
= (
ret
>=
size
) ?
size
-
1
:
ret
;
9
memcpy
(
dest
,
src
,
len
);
10
dest
[
len
] =
'\0'
;
11
}
12
return
ret
;
13
}