From 5f4f0ccfc6c1540d17cc55b36ac32af6d6b208f6 Mon Sep 17 00:00:00 2001 From: Johan Danielsson Date: Mon, 13 Apr 1998 10:23:33 +0000 Subject: [PATCH] Some casts. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4768 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/ftp/ftp/security.c | 2 +- appl/ftp/ftpd/ftpcmd.y | 22 ++++++++++++---------- appl/ftp/ftpd/ftpd.c | 6 +++--- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/appl/ftp/ftp/security.c b/appl/ftp/ftp/security.c index bd3c474a1..2638aa763 100644 --- a/appl/ftp/ftp/security.c +++ b/appl/ftp/ftp/security.c @@ -436,7 +436,7 @@ void pbsz(int size) buffer_size = size; } if(new != size) - reply(200, "PBSZ=%lu", new); + reply(200, "PBSZ=%lu", (unsigned long)new); else reply(200, "OK"); } diff --git a/appl/ftp/ftpd/ftpcmd.y b/appl/ftp/ftpd/ftpcmd.y index f433428f9..968fa03ab 100644 --- a/appl/ftp/ftpd/ftpcmd.y +++ b/appl/ftp/ftpd/ftpcmd.y @@ -324,14 +324,16 @@ cmd } | STAT CRLF { - if(oobflag){ - if (file_size != (off_t) -1) - reply(213, "Status: %ld of %ld bytes transferred", - byte_count, file_size); - else - reply(213, "Status: %ld bytes transferred", byte_count); - }else - statcmd(); + if(oobflag){ + if (file_size != (off_t) -1) + reply(213, "Status: %ld of %ld bytes transferred", + (unsigned long)byte_count, + (unsigned long)file_size); + else + reply(213, "Status: %ld bytes transferred", + (unsigned long)byte_count); + }else + statcmd(); } | DELE check_login_no_guest SP pathname CRLF { @@ -1382,7 +1384,7 @@ sizecmd(char *filename) case TYPE_A: { FILE *fin; int c; - off_t count; + size_t count; struct stat stbuf; fin = fopen(filename, "r"); if (fin == NULL) { @@ -1403,7 +1405,7 @@ sizecmd(char *filename) } fclose(fin); - reply(213, "%ld", count); + reply(213, "%ld", (unsigned long)count); break; } default: reply(504, "SIZE not implemented for Type %c.", "?AEIL"[type]); diff --git a/appl/ftp/ftpd/ftpd.c b/appl/ftp/ftpd/ftpd.c index 35f596ec8..bcef44068 100644 --- a/appl/ftp/ftpd/ftpd.c +++ b/appl/ftp/ftpd/ftpd.c @@ -1096,10 +1096,10 @@ dataconn(char *name, off_t size, char *mode) file_size = size; byte_count = 0; - if (size != (off_t) -1) - snprintf(sizebuf, sizeof(sizebuf), " (%ld bytes)", size); + if (size >= 0) + snprintf(sizebuf, sizeof(sizebuf), " (%ld bytes)", (long)size); else - strcpy(sizebuf, ""); + strcpy(sizebuf, ""); if (pdata >= 0) { struct sockaddr_in from; int s, fromlen = sizeof(from);