strlcat.c

来自「newos is new operation system」· C语言 代码 · 共 29 行

C
29
字号
/*** Copyright 2002, Manuel J. Petit. All rights reserved.** Distributed under the terms of the NewOS License.*/#include <string.h>#include <sys/types.h>size_tstrlcat(char *dst, char const *src, size_t s){	size_t i;	size_t j= strnlen(dst, s);	if(!s) {		return j+strlen(src);	}	dst+= j;	for(i= 0; ((i< s-1) && src[i]); i++) {		dst[i]= src[i];	}	dst[i]= 0;	return j + i + strlen(src+i);}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?