From c870bdb628e6424e3faade22790009b53767cf7e Mon Sep 17 00:00:00 2001 From: "bernard.xiong" Date: Thu, 18 Mar 2010 02:00:23 +0000 Subject: [PATCH] revert gary.li changes on strlcpy function. git-svn-id: https://rt-thread.googlecode.com/svn/trunk@503 bbd45198-f89e-11dd-88c7-29a3b14d5316 --- libc/minilibc/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/minilibc/string.c b/libc/minilibc/string.c index e7fc6d400..2de4f2079 100644 --- a/libc/minilibc/string.c +++ b/libc/minilibc/string.c @@ -38,7 +38,7 @@ size_t strlcpy(char *dst, const char *src, size_t siz) register size_t n = siz; /* Copy as many bytes as will fit */ - if (n != 0) + if (n != 0 && --n != 0) { do { -- GitLab