Merge 6093e2e0831fe90a138bd647716b91f7de0f9040 into 290933b4a7964d56f74d2e3c61f7045c5e0d6bfe

This commit is contained in:
agialluc 2025-01-28 15:46:26 -08:00 committed by GitHub
commit f85ba65787
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 13 deletions

View File

@ -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));
}
@ -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));
}
@ -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));
}

View File

@ -2569,7 +2569,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;
}
}