📄 strmcat.c
字号:
/* strmcat.c
Copy str2 to str1, keeping str1 <= max_str_length excluding NULL.
Returns pointer to str1.
*/
#include <stdtypes.h>
#include <clib1.h>
#include <string.h>
CHAR *strmcat( CHAR *str1, WORD max_str_length, CHAR *str2 )
{
LONG i = 0;
LONG str1len = (LONG)( strlen( str1 ) ); /* current str1 size (w/o NULL) */
CHAR *sptr;
if ( str1len >= max_str_length ) return(str1);
/* point to NULL (first char to add) */
sptr = (CHAR *) ((LONG)str1 + str1len);/* point to NULL (first char to add) */
while ( ((str1len + i) < max_str_length) && (*str2 != 0) )
{
*sptr++ = *str2++;
i++;
}
*sptr = 0; /* add the NULL */
return(str1);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -