Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions conserver/cutil.c
Original file line number Diff line number Diff line change
Expand Up @@ -618,19 +618,19 @@ FileOpenFD(int fd, enum consFileType type)
#if DEBUG_CONSFILE_IO
{
char buf[1024];
sprintf(buf, "CONSFILE-%s-%lu-%d.w", progname,
snprintf(buf, sizeof(buf), "CONSFILE-%s-%lu-%d.w", progname,
(unsigned long)thepid, fd);
if ((cfp->debugwfd =
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
sprintf(buf, "[---- STARTED - %s ----]\n",
snprintf(buf, sizeof(buf), "[---- STARTED - %s ----]\n",
StrTime((time_t *)0));
write(cfp->debugwfd, buf, strlen(buf));
}
sprintf(buf, "CONSFILE-%s-%lu-%d.r", progname,
snprintf(buf, sizeof(buf), "CONSFILE-%s-%lu-%d.r", progname,
(unsigned long)thepid, fd);
if ((cfp->debugrfd =
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
sprintf(buf, "[---- STARTED - %s ----]\n",
snprintf(buf, sizeof(buf), "[---- STARTED - %s ----]\n",
StrTime((time_t *)0));
write(cfp->debugrfd, buf, strlen(buf));
}
Expand Down Expand Up @@ -663,19 +663,19 @@ FileOpenPipe(int fd, int fdout)
#if DEBUG_CONSFILE_IO
{
char buf[1024];
sprintf(buf, "CONSFILE-%s-%lu-%d.w", progname,
snprintf(buf, sizeof(buf), "CONSFILE-%s-%lu-%d.w", progname,
(unsigned long)thepid, fdout);
if ((cfp->debugwfd =
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
sprintf(buf, "[---- STARTED - %s ----]\n",
snprintf(buf, sizeof(buf), "[---- STARTED - %s ----]\n",
StrTime((time_t *)0));
write(cfp->debugwfd, buf, strlen(buf));
}
sprintf(buf, "CONSFILE-%s-%lu-%d.r", progname,
snprintf(buf, sizeof(buf), "CONSFILE-%s-%lu-%d.r", progname,
(unsigned long)thepid, fd);
if ((cfp->debugrfd =
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
sprintf(buf, "[---- STARTED - %s ----]\n",
snprintf(buf, sizeof(buf), "[---- STARTED - %s ----]\n",
StrTime((time_t *)0));
write(cfp->debugrfd, buf, strlen(buf));
}
Expand Down Expand Up @@ -754,19 +754,19 @@ FileOpen(const char *path, int flag, int mode)
#if DEBUG_CONSFILE_IO
{
char buf[1024];
sprintf(buf, "CONSFILE-%s-%lu-%d.w", progname,
snprintf(buf, sizeof(buf), "CONSFILE-%s-%lu-%d.w", progname,
(unsigned long)thepid, fd);
if ((cfp->debugwfd =
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
sprintf(buf, "[---- STARTED - %s ----]\n",
snprintf(buf, sizeof(buf), "[---- STARTED - %s ----]\n",
StrTime((time_t *)0));
write(cfp->debugwfd, buf, strlen(buf));
}
sprintf(buf, "CONSFILE-%s-%lu-%d.r", progname,
snprintf(buf, sizeof(buf), "CONSFILE-%s-%lu-%d.r", progname,
(unsigned long)thepid, fd);
if ((cfp->debugrfd =
open(buf, O_WRONLY | O_CREAT | O_APPEND, 0644)) != -1) {
sprintf(buf, "[---- STARTED - %s ----]\n",
snprintf(buf, sizeof(buf), "[---- STARTED - %s ----]\n",
StrTime((time_t *)0));
write(cfp->debugrfd, buf, strlen(buf));
}
Expand Down
2 changes: 1 addition & 1 deletion conserver/group.c
Original file line number Diff line number Diff line change
Expand Up @@ -2560,7 +2560,7 @@ TelOpt(int o)
if (o < sizeof(telopts) / sizeof(char *))
return telopts[o];
else {
sprintf(opt, "%d", o);
snprintf(opt, sizeof(opt), "%d", o);
return opt;
}
}
Expand Down