Printf(3) off_t values through conversion to intmax_t since

we've got <stdint.h> et al now.  (This makes ftpd(8) WARNS=2 clean.)
This commit is contained in:
Yaroslav Tykhiy 2004-07-31 14:22:02 +00:00
parent aa087e0e12
commit a57e1ef070
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=132929
2 changed files with 15 additions and 10 deletions

View File

@ -64,6 +64,7 @@ static const char rcsid[] =
#include <netdb.h>
#include <pwd.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -786,8 +787,8 @@ rcmd
free(fromname);
fromname = (char *) 0;
restart_point = $4.o;
reply(350, "Restarting at %llu. %s",
restart_point,
reply(350, "Restarting at %jd. %s",
(intmax_t)restart_point,
"Send STORE or RETRIEVE to initiate transfer.");
}
}
@ -1578,7 +1579,7 @@ sizecmd(char *filename)
else if (!S_ISREG(stbuf.st_mode))
reply(550, "%s: not a plain file.", filename);
else
reply(213, "%qu", stbuf.st_size);
reply(213, "%jd", (intmax_t)stbuf.st_size);
break; }
case TYPE_A: {
FILE *fin;
@ -1612,7 +1613,7 @@ sizecmd(char *filename)
}
(void) fclose(fin);
reply(213, "%qd", count);
reply(213, "%jd", (intmax_t)count);
break; }
default:
reply(504, "SIZE not implemented for type %s.",

View File

@ -80,6 +80,7 @@ static const char rcsid[] =
#include <grp.h>
#include <opie.h>
#include <signal.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ -229,8 +230,9 @@ char proctitle[LINE_MAX]; /* initial part of title */
syslog(LOG_INFO,"%s %s%s", cmd, \
*(file) == '/' ? "" : curdir(), file); \
else \
syslog(LOG_INFO, "%s %s%s = %qd bytes", \
cmd, (*(file) == '/') ? "" : curdir(), file, cnt); \
syslog(LOG_INFO, "%s %s%s = %jd bytes", \
cmd, (*(file) == '/') ? "" : curdir(), file, \
(intmax_t)cnt); \
}
#ifdef VIRTUAL_HOSTING
@ -1882,7 +1884,8 @@ dataconn(char *name, off_t size, char *mode)
file_size = size;
byte_count = 0;
if (size != (off_t) -1)
(void) snprintf(sizebuf, sizeof(sizebuf), " (%qd bytes)", size);
(void) snprintf(sizebuf, sizeof(sizebuf),
" (%jd bytes)", (intmax_t)size);
else
*sizebuf = '\0';
if (pdata >= 0) {
@ -2656,10 +2659,11 @@ myoob(void)
if (strcmp(cp, "STAT\r\n") == 0) {
tmpline[0] = '\0';
if (file_size != (off_t) -1)
reply(213, "Status: %qd of %qd bytes transferred",
byte_count, file_size);
reply(213, "Status: %jd of %jd bytes transferred",
(intmax_t)byte_count, (intmax_t)file_size);
else
reply(213, "Status: %qd bytes transferred", byte_count);
reply(213, "Status: %jd bytes transferred",
(intmax_t)byte_count);
}
}