提交 4d3fb8a1 编写于 作者: L Legend Zhang

Update string.c : fix bug in strcat when dst start with '\0'

上级 5fb66a38
...@@ -27,7 +27,8 @@ char* strncpy(char* dst, const char* src, size_t n){ ...@@ -27,7 +27,8 @@ char* strncpy(char* dst, const char* src, size_t n){
char* strcat(char* dst, const char* src){ char* strcat(char* dst, const char* src){
char* d=dst; char* d=dst;
while(*++dst!='\0'); while(*dst!='\0')
dst++;
while((*dst++=*src++)!='\0'); while((*dst++=*src++)!='\0');
return d; return d;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册