replace sprintf all over the place

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1635 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1997-05-02 14:29:33 +00:00
parent 1495f52771
commit dd02a92a8b
55 changed files with 831 additions and 471 deletions

View File

@@ -26,7 +26,7 @@ pop_dropcopy(POP *p, struct passwd *pwp)
int nchar; /* Bytes written/read */
/* Create a temporary maildrop into which to copy the updated maildrop */
sprintf(p->temp_drop,POP_DROP,p->user);
snprintf(p->temp_drop, sizeof(p->temp_drop), POP_DROP,p->user);
#ifdef DEBUG
if(p->debug)

View File

@@ -24,10 +24,8 @@ pop_msg(POP *p, int stat, char *format, ...)
mp = message;
/* Format the POP status code at the beginning of the message */
if (stat == POP_SUCCESS)
sprintf (mp,"%s ",POP_OK);
else
sprintf (mp,"%s ",POP_ERR);
snprintf (mp, sizeof(message), "%s ",
(stat == POP_SUCCESS) ? POP_OK : POP_ERR);
/* Point past the POP status indicator in the message message */
mp += strlen(mp);

View File

@@ -49,7 +49,8 @@ pop_pass (POP *p)
"Password supplied for \"%s\" is incorrect.",
p->user));
sprintf (tkt, TKT_ROOT "_popper.%d", (int)getpid());
snprintf (tkt, sizeof(tkt),
TKT_ROOT "_popper.%u", (unsigned)getpid());
krb_set_tkt_string (tkt);
if (otp_verify_user (&p->otp_ctx, p->pop_parm[1]) == 0)
;
@@ -78,7 +79,7 @@ pop_pass (POP *p)
}
/* Build the name of the user's maildrop */
sprintf(p->drop_name, "%s/%s", POP_MAILDIR, p->user);
snprintf(p->drop_name, sizeof(p->drop_name), "%s/%s", POP_MAILDIR, p->user);
/* Make a temporary copy of the user's maildrop */
/* and set the group and user id */

View File

@@ -15,7 +15,7 @@ pop_xover (POP *p)
/* Loop through the message information list. Skip deleted messages */
for (i = p->msg_count, mp = p->mlp; i > 0; i--, mp++) {
if (!mp->del_flag)
fprintf(p->output,"%u\t%s\t%s\t%s\t%s\t%lu\t%lu\r\n",
fprintf(p->output,"%u\t%s\t%s\t%s\t%s\t%lu\t%u\r\n",
mp->number,
mp->subject,
mp->from,