strncat
char *ho_strncat(char *s1, char *s2, int n) {
char *s = s1;
while (*s1)
s1++;
while (n-- && (*s1++ = *s2++) != '\0') {
}
*s1 = '\0';
return s;
}
strncat
char *ho_strncat(char *s1, char *s2, int n) {
char *s = s1;
while (*s1)
s1++;
while (n-- && (*s1++ = *s2++) != '\0') {
}
*s1 = '\0';
return s;
}
转载于:https://my.oschina.net/guonaihong/blog/402106