summaryrefslogtreecommitdiffstats
path: root/libexec
diff options
context:
space:
mode:
authoryar <yar@FreeBSD.org>2004-07-31 14:46:41 +0000
committeryar <yar@FreeBSD.org>2004-07-31 14:46:41 +0000
commit06b7ed859fcdd8e379c1a413d95f865b62f16e31 (patch)
tree17700412e15550d07676bad05fd8dc448ca0f706 /libexec
parent634a2a6e4f60688d317d50500d9304c2cadd10be (diff)
downloadFreeBSD-src-06b7ed859fcdd8e379c1a413d95f865b62f16e31.zip
FreeBSD-src-06b7ed859fcdd8e379c1a413d95f865b62f16e31.tar.gz
Kill a small herd of casts to off_t where they were not needed.
Thank Fortune, the C compiler can figure out by itself the proper conversion for assignments, comparisons, and prototyped function arguments.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpcmd.y4
-rw-r--r--libexec/ftpd/ftpd.c15
2 files changed, 9 insertions, 10 deletions
diff --git a/libexec/ftpd/ftpcmd.y b/libexec/ftpd/ftpcmd.y
index bb8744b..2dc49d0 100644
--- a/libexec/ftpd/ftpcmd.y
+++ b/libexec/ftpd/ftpcmd.y
@@ -160,7 +160,7 @@ cmd_list
if (fromname)
free(fromname);
fromname = (char *) 0;
- restart_point = (off_t) 0;
+ restart_point = 0;
}
| cmd_list rcmd
;
@@ -767,7 +767,7 @@ cmd
rcmd
: RNFR check_login_ro SP pathname CRLF
{
- restart_point = (off_t) 0;
+ restart_point = 0;
if ($2 && $4) {
if (fromname)
free(fromname);
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index b894b68..75c41ac 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -226,7 +226,7 @@ char proctitle[LINE_MAX]; /* initial part of title */
*(file2) == '/' ? "" : curdir(), file2);
#define LOGBYTES(cmd, file, cnt) \
if (logging > 1) { \
- if (cnt == (off_t)-1) \
+ if (cnt == -1) \
syslog(LOG_INFO,"%s %s%s", cmd, \
*(file) == '/' ? "" : curdir(), file); \
else \
@@ -1773,7 +1773,7 @@ store(char *name, char *mode, int unique)
* because we are changing from reading to
* writing.
*/
- if (fseeko(fout, (off_t)0, SEEK_CUR) < 0) {
+ if (fseeko(fout, 0, SEEK_CUR) < 0) {
perror_reply(550, name);
goto done;
}
@@ -1782,7 +1782,7 @@ store(char *name, char *mode, int unique)
goto done;
}
}
- din = dataconn(name, (off_t)-1, "r");
+ din = dataconn(name, -1, "r");
if (din == NULL)
goto done;
if (receive_data(din, fout) == 0) {
@@ -1883,7 +1883,7 @@ dataconn(char *name, off_t size, char *mode)
file_size = size;
byte_count = 0;
- if (size != (off_t) -1)
+ if (size != -1)
(void) snprintf(sizebuf, sizeof(sizebuf),
" (%jd bytes)", (intmax_t)size);
else
@@ -2658,7 +2658,7 @@ myoob(void)
}
if (strcmp(cp, "STAT\r\n") == 0) {
tmpline[0] = '\0';
- if (file_size != (off_t) -1)
+ if (file_size != -1)
reply(213, "Status: %jd of %jd bytes transferred",
(intmax_t)byte_count, (intmax_t)file_size);
else
@@ -3023,7 +3023,7 @@ send_file_list(char *whichf)
if (S_ISREG(st.st_mode)) {
if (dout == NULL) {
- dout = dataconn("file list", (off_t)-1, "w");
+ dout = dataconn("file list", -1, "w");
if (dout == NULL)
goto out;
transflag++;
@@ -3064,8 +3064,7 @@ send_file_list(char *whichf)
if (simple || (stat(nbuf, &st) == 0 &&
S_ISREG(st.st_mode))) {
if (dout == NULL) {
- dout = dataconn("file list", (off_t)-1,
- "w");
+ dout = dataconn("file list", -1, "w");
if (dout == NULL)
goto out;
transflag++;
OpenPOWER on IntegriCloud