Browse Source

fix warnings found by clang

pull/10/head
Philipp Toelke 11 years ago
parent
commit
288538a029
  1. 56
      ftpd.c
  2. 2
      vfs.h

56
ftpd.c

@ -598,7 +598,7 @@ static err_t ftpd_datarecv(void *arg, struct tcp_pcb *pcb, struct pbuf *p, err_t
if (err == ERR_OK && p != NULL) { if (err == ERR_OK && p != NULL) {
struct pbuf *q; struct pbuf *q;
u16_t tot_len; u16_t tot_len = 0;
for (q = p; q != NULL; q = q->next) { for (q = p; q != NULL; q = q->next) {
int len; int len;
@ -793,7 +793,7 @@ static void cmd_pwd(const char *arg, struct tcp_pcb *pcb, struct ftpd_msgstate *
{ {
char *path; char *path;
if (path = vfs_getcwd(fsm->vfs, NULL, 0)) { if ((path = vfs_getcwd(fsm->vfs, NULL, 0))) {
send_msg(pcb, fsm, msg257PWD, path); send_msg(pcb, fsm, msg257PWD, path);
free(path); free(path);
} }
@ -1118,32 +1118,32 @@ struct ftpd_command {
}; };
static struct ftpd_command ftpd_commands[] = { static struct ftpd_command ftpd_commands[] = {
"USER", cmd_user, {"USER", cmd_user},
"PASS", cmd_pass, {"PASS", cmd_pass},
"PORT", cmd_port, {"PORT", cmd_port},
"QUIT", cmd_quit, {"QUIT", cmd_quit},
"CWD", cmd_cwd, {"CWD", cmd_cwd},
"CDUP", cmd_cdup, {"CDUP", cmd_cdup},
"PWD", cmd_pwd, {"PWD", cmd_pwd},
"XPWD", cmd_pwd, {"XPWD", cmd_pwd},
"NLST", cmd_nlst, {"NLST", cmd_nlst},
"LIST", cmd_list, {"LIST", cmd_list},
"RETR", cmd_retr, {"RETR", cmd_retr},
"STOR", cmd_stor, {"STOR", cmd_stor},
"NOOP", cmd_noop, {"NOOP", cmd_noop},
"SYST", cmd_syst, {"SYST", cmd_syst},
"ABOR", cmd_abrt, {"ABOR", cmd_abrt},
"TYPE", cmd_type, {"TYPE", cmd_type},
"MODE", cmd_mode, {"MODE", cmd_mode},
"RNFR", cmd_rnfr, {"RNFR", cmd_rnfr},
"RNTO", cmd_rnto, {"RNTO", cmd_rnto},
"MKD", cmd_mkd, {"MKD", cmd_mkd},
"XMKD", cmd_mkd, {"XMKD", cmd_mkd},
"RMD", cmd_rmd, {"RMD", cmd_rmd},
"XRMD", cmd_rmd, {"XRMD", cmd_rmd},
"DELE", cmd_dele, {"DELE", cmd_dele},
//"PASV", cmd_pasv, //{"PASV", cmd_pasv},
NULL {NULL, NULL}
}; };
static void send_msgdata(struct tcp_pcb *pcb, struct ftpd_msgstate *fsm) static void send_msgdata(struct tcp_pcb *pcb, struct ftpd_msgstate *fsm)

2
vfs.h

@ -41,7 +41,7 @@ typedef struct {
typedef DIR vfs_dir_t; typedef DIR vfs_dir_t;
typedef FIL vfs_file_t; typedef FIL vfs_file_t;
typedef struct { typedef struct {
int st_size; long st_size;
char st_mode; char st_mode;
time_t st_mtime; time_t st_mtime;
} vfs_stat_t; } vfs_stat_t;

Loading…
Cancel
Save