*** empty log message ***

This commit is contained in:
cvs
2000-03-15 10:10:22 +00:00
parent 749772c6ae
commit 49669ee311
13 changed files with 2601 additions and 90 deletions

View File

@@ -163,10 +163,20 @@ int str_cmp(const char *str1, const char *str2) {
return(0);
}
int str_ncpy(char *dst, const char *src, int n) {
strncpy(dst, src, n);
if (dst[n-1]!='\0') {
dst[n-1]='\0';
int str_ncpy(char *dst, const char *src, int maxdest) {
strncpy(dst, src, maxdest);
if (dst[maxdest-1]!='\0') {
dst[maxdest-1]='\0';
ERR_MSG("destination string too short");
}
return(0);
OnError: return(-1);
}
int str_ncat(char *dst, const char *src, int maxdest) {
strncat(dst, src, maxdest-strlen(dst)-1);
if (dst[maxdest-1]!='\0') {
dst[maxdest-1]='\0';
ERR_MSG("destination string too short");
}
return(0);