public
/
FUZIX.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1600753
)
strlcpy: make more robust
author
Alan Cox
<alan@linux.intel.com>
Mon, 22 Jan 2018 00:09:09 +0000
(
00:09
+0000)
committer
Alan Cox
<alan@linux.intel.com>
Mon, 22 Jan 2018 00:09:09 +0000
(
00:09
+0000)
Library/libs/strlcpy.c
patch
|
blob
|
history
diff --git
a/Library/libs/strlcpy.c
b/Library/libs/strlcpy.c
index
e565d8b
..
f4d2cf6
100644
(file)
--- a/
Library/libs/strlcpy.c
+++ b/
Library/libs/strlcpy.c
@@
-2,7
+2,7
@@
size_t strlcpy(char *dst, const char *src, size_t dstsize)
{
- size_t len = str
len(src
);
+ size_t len = str
nlen(src, dstsize
);
size_t cp = len >= dstsize ? dstsize - 1 : len;
memcpy(dst, src, cp);
dst[cp] = 0;