large strc{py,at}_truncate -> strlc{py,at} replacement

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6984 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-09-16 20:41:57 +00:00
parent 8e441f1158
commit bf75fac82a
42 changed files with 176 additions and 171 deletions

View File

@@ -56,7 +56,7 @@ loop(int s)
if(FD_ISSET(0, &fds)){
fgets(cmd, sizeof(cmd), stdin);
cmd[strlen(cmd) - 1] = '\0';
strcat_truncate (cmd, "\r\n", sizeof(cmd));
strlcat (cmd, "\r\n", sizeof(cmd));
write(s, cmd, strlen(cmd));
}
if(FD_ISSET(s, &fds)){

View File

@@ -73,7 +73,7 @@ pop_dropcopy(POP *p, struct passwd *pwp)
* running as root.
*/
strcpy_truncate(template, POP_TMPDROP, sizeof(template));
strlcpy(template, POP_TMPDROP, sizeof(template));
if ((tf_fd = mkstemp(template)) < 0 ||
(tf = fdopen(tf_fd, "w+")) == NULL) {
pop_log(p,POP_PRIORITY,

View File

@@ -196,7 +196,7 @@ pop_dropinfo(POP *p)
"Msg %d at offset %ld being added to list",
mp->number, mp->offset);
#endif /* DEBUG */
}else if(in_header)
} else if(in_header)
parse_header(mp, buffer);
blank_line = (strncmp(buffer, "\n", nchar) == 0);
if(blank_line) {

View File

@@ -49,7 +49,7 @@ pop_get_command(POP *p, char *mp)
/* Save a copy of the original client line */
#ifdef DEBUG
if(p->debug) strcpy_truncate (buf, mp, sizeof(buf));
if(p->debug) strlcpy (buf, mp, sizeof(buf));
#endif /* DEBUG */
/* Parse the message into the parameter array */

View File

@@ -319,7 +319,7 @@ pop_init(POP *p,int argcount,char **argmessage)
if (ch == NULL){
pop_log(p,POP_PRIORITY,
"Unable to get canonical name of client, err = %d",error);
strcpy_truncate (p->client, p->ipaddr, sizeof(p->client));
strlcpy (p->client, p->ipaddr, sizeof(p->client));
}
/* Save the cannonical name of the client host in
the POP parameter block */
@@ -339,12 +339,12 @@ pop_init(POP *p,int argcount,char **argmessage)
pop_log(p,POP_PRIORITY,
"Client at \"%s\" resolves to an unknown host name \"%s\"",
p->ipaddr,ch->h_name);
strcpy_truncate (p->client, p->ipaddr, sizeof(p->client));
strlcpy (p->client, p->ipaddr, sizeof(p->client));
}
else {
/* Save the host name (the previous value was
destroyed by gethostbyname) */
strcpy_truncate (p->client, ch->h_name, sizeof(p->client));
strlcpy (p->client, ch->h_name, sizeof(p->client));
/* Look for the client's IP address in the list returned
for its name */
@@ -358,7 +358,7 @@ pop_init(POP *p,int argcount,char **argmessage)
pop_log (p,POP_PRIORITY,
"Client address \"%s\" not listed for its host name \"%s\"",
p->ipaddr,ch->h_name);
strcpy_truncate (p->client, p->ipaddr, sizeof(p->client));
strlcpy (p->client, p->ipaddr, sizeof(p->client));
}
}
freehostent (ch_again);

View File

@@ -46,7 +46,7 @@ pop_msg(POP *p, int stat, char *format, ...)
pop_log(p,POP_PRIORITY,"%s",message);
/* Append the <CR><LF> */
strcat_truncate(message, "\r\n", sizeof(message));
strlcat(message, "\r\n", sizeof(message));
/* Send the message to the client */
fputs(message, p->output);

View File

@@ -16,7 +16,7 @@ pop_user (POP *p)
{
char ss[256];
strcpy_truncate(p->user, p->pop_parm[1], sizeof(p->user));
strlcpy(p->user, p->pop_parm[1], sizeof(p->user));
#ifdef OTP
if (otp_challenge (&p->otp_ctx, p->user, ss, sizeof(ss)) == 0) {