diff --git a/reactos/apps/utils/net/ftp/domacro.c b/reactos/apps/utils/net/ftp/domacro.c index a4eeed1914a..b2de0fe4741 100644 --- a/reactos/apps/utils/net/ftp/domacro.c +++ b/reactos/apps/utils/net/ftp/domacro.c @@ -36,9 +36,8 @@ void domacro(argc, argv) register char *cp1, *cp2; int count = 2, loopflg = 0; char line2[200]; - extern char **glob(), *globerr; + extern char **glob(); struct cmd *getcmd(), *c; - extern struct cmd cmdtab[]; if (argc < 2) { (void) strcat(line, " "); diff --git a/reactos/apps/utils/net/ftp/fake.c b/reactos/apps/utils/net/ftp/fake.c index b7da561bab0..11926562410 100644 --- a/reactos/apps/utils/net/ftp/fake.c +++ b/reactos/apps/utils/net/ftp/fake.c @@ -1,6 +1,7 @@ #include #include #include +#include "fake.h" #include "prototypes.h" #define MAX_ASCII 100 @@ -305,12 +306,7 @@ int access(const char *filename, int accessmethod) #define EPOCHFILETIME (116444736000000000LL) #endif -struct timezone { - int tz_minuteswest; /* minutes W of Greenwich */ - int tz_dsttime; /* type of dst correction */ -}; - -__inline int gettimeofday(struct timeval *tv, struct timezone *tz) +int gettimeofday(struct timeval *tv, struct timezone *tz) { FILETIME ft; LARGE_INTEGER li; diff --git a/reactos/apps/utils/net/ftp/fake.h b/reactos/apps/utils/net/ftp/fake.h index 816c7818064..68c94cc749f 100644 --- a/reactos/apps/utils/net/ftp/fake.h +++ b/reactos/apps/utils/net/ftp/fake.h @@ -8,3 +8,10 @@ #define strcasecmp strcmp #define strncasecmp strnicmp + +struct timezone { + int tz_minuteswest; /* minutes W of Greenwich */ + int tz_dsttime; /* type of dst correction */ +}; + +int gettimeofday(struct timeval *tv, struct timezone *tz); diff --git a/reactos/apps/utils/net/ftp/ftp.c b/reactos/apps/utils/net/ftp/ftp.c index 264dd91e578..45a7c8dde90 100644 --- a/reactos/apps/utils/net/ftp/ftp.c +++ b/reactos/apps/utils/net/ftp/ftp.c @@ -320,6 +320,7 @@ char reply_string[BUFSIZ]; /* last line of previous reply */ #include +int getreply(expecteof) int expecteof; { @@ -371,7 +372,7 @@ getreply(expecteof) if (c != '\r' && (verbose > 0 || (verbose > -1 && n == '5' && dig > 4))) { if (proxflag && - (dig == 1 || dig == 5 && verbose == 0)) + ((dig == 1 || dig == 5) && verbose == 0)) printf("%s:",hostname); (void) putchar(c); (void) fflush(stdout); @@ -400,7 +401,7 @@ getreply(expecteof) if (cp < &reply_string[sizeof(reply_string) - 1]) *cp++ = c; } - if (verbose > 0 || verbose > -1 && n == '5') { + if (verbose > 0 || (verbose > -1 && n == '5')) { (void) putchar(c); (void) fflush (stdout); } @@ -421,6 +422,7 @@ getreply(expecteof) } } +int empty(mask, sec) struct fd_set *mask; int sec; @@ -995,7 +997,7 @@ done: } break2: if (bare_lfs) { - printf("WARNING! %d bare linefeeds received in ASCII mode\n"); + printf("WARNING! %d bare linefeeds received in ASCII mode\n", bare_lfs); printf("File may not have transferred correctly.\n"); (void) fflush(stdout); } @@ -1134,6 +1136,7 @@ null();// (void) signal(SIGINT,oldintr); */ int sendport = -1; +int initconn() { register char *p, *a; diff --git a/reactos/apps/utils/net/ftp/ftp.xml b/reactos/apps/utils/net/ftp/ftp.xml index abc7f2d65b2..a6017dd0a0b 100644 --- a/reactos/apps/utils/net/ftp/ftp.xml +++ b/reactos/apps/utils/net/ftp/ftp.xml @@ -1,6 +1,7 @@ . + kernel32 ws2_32 iphlpapi diff --git a/reactos/apps/utils/net/ftp/ftp_var.h b/reactos/apps/utils/net/ftp/ftp_var.h index 7c33434a7e7..8d17f7d68d8 100644 --- a/reactos/apps/utils/net/ftp/ftp_var.h +++ b/reactos/apps/utils/net/ftp/ftp_var.h @@ -1,5 +1,5 @@ -#include "fake.h" #include +#include "fake.h" #include //typedef void (*Sig_t)(int); diff --git a/reactos/apps/utils/net/ftp/main.c b/reactos/apps/utils/net/ftp/main.c index fd6c506b2b2..a0e7a23e6a3 100644 --- a/reactos/apps/utils/net/ftp/main.c +++ b/reactos/apps/utils/net/ftp/main.c @@ -127,7 +127,6 @@ int main(int argc, char *argv[]) { register char *cp; int top; - struct passwd *pw = NULL; #if 0 char homedir[MAXPATHLEN]; #endif @@ -369,7 +368,7 @@ getcmd(name) longest = 0; nmatches = 0; found = 0; - for (c = cmdtab; p = c->c_name; c++) { + for (c = cmdtab; (p = c->c_name); c++) { for (q = name; *q == *p++; q++) if (*q == 0) /* exact match? */ return (c); @@ -403,7 +402,7 @@ void makeargv() stringbase = line; /* scan from first of buffer */ argbase = argbuf; /* store from first of buffer */ slrflag = 0; - while (*argp++ = slurpstring()) + while ((*argp++ = slurpstring())) margc++; } diff --git a/reactos/apps/utils/net/ftp/prototypes.h b/reactos/apps/utils/net/ftp/prototypes.h index 3bff115d48f..404c0117084 100644 --- a/reactos/apps/utils/net/ftp/prototypes.h +++ b/reactos/apps/utils/net/ftp/prototypes.h @@ -28,5 +28,4 @@ void recvrequest(char *cmd, char *local, char *remote, char *mode, int confirm(char *cmd, char *file); void blkfree(char **av0); int getit(int argc, char *argv[], int restartit, char *mode); -static int token(void); int sleep(int time); diff --git a/reactos/apps/utils/net/ftp/ruserpass.c b/reactos/apps/utils/net/ftp/ruserpass.c index 3c7f17779c8..dbf2182183b 100644 --- a/reactos/apps/utils/net/ftp/ruserpass.c +++ b/reactos/apps/utils/net/ftp/ruserpass.c @@ -53,17 +53,18 @@ static struct toktab { char *tokstr; int tval; } toktab[]= { - "default", DEFAULT, - "login", LOGIN, - "password", PASSWD, - "passwd", PASSWD, - "account", ACCOUNT, - "machine", MACH, - "macdef", MACDEF, - 0, 0 + {"default", DEFAULT}, + {"login", LOGIN}, + {"password", PASSWD}, + {"passwd", PASSWD}, + {"account", ACCOUNT}, + {"machine", MACH}, + {"macdef", MACDEF}, + {0, 0} }; extern char *hostname; +static int token(void); int ruserpass(char *host, char **aname, char **apass, char **aacct) { @@ -125,7 +126,7 @@ next: while ((t = token()) && t != MACH && t != DEFAULT) switch(t) { case LOGIN: - if (token()) + if (token()) { if (*aname == 0) { *aname = malloc((unsigned) strlen(tokval) + 1); (void) strcpy(*aname, tokval); @@ -133,6 +134,7 @@ next: if (strcmp(*aname, tokval)) goto next; } + } break; case PASSWD: if (strcmp(*aname, "anonymous") && @@ -164,7 +166,7 @@ next: (void) fclose(cfile); return(0); } - while ((c=getc(cfile)) != EOF && c == ' ' || c == '\t'); + while ((c=getc(cfile)) != EOF && (c == ' ' || c == '\t')); if (c == EOF || c == '\n') { printf("Missing macdef name argument.\n"); goto bad;