build with -Wall -Wextra -Werror and fix errors

This commit is contained in:
josch
2014-09-19 09:21:28 +02:00
parent ef3b2aa844
commit b322f68ad2
21 changed files with 66 additions and 24 deletions

View File

@@ -36,7 +36,6 @@ _get_passwd_from_user(void);
int
mfshell_cmd_auth(mfshell_t *mfshell, int argc, char **argv)
{
int retval;
char *username;
char *password;

View File

@@ -30,6 +30,7 @@
int
mfshell_cmd_debug(mfshell_t *mfshell, int argc, char **argv)
{
(void)argv;
if (argc != 1) {
fprintf(stderr, "Invalid number of arguments\n");
return -1;

View File

@@ -52,6 +52,9 @@ mfshell_cmd_file(mfshell_t *mfshell, int argc, char **argv)
file = file_alloc();
retval = mfconn_api_file_get_info(mfshell->mfconn,file,(char*)quickkey);
if (retval != 0) {
fprintf(stderr, "api call unsuccessful\n");
}
mfconn_update_secret_key(mfshell->mfconn);
quickkey = file_get_key(file);

View File

@@ -80,9 +80,9 @@ mfshell_cmd_get(mfshell_t *mfshell, int argc, char **argv)
getcwd(mfshell->local_working_dir,PATH_MAX);
}
retval = file_download_direct(file, mfshell->local_working_dir);
bytes_read = file_download_direct(file, mfshell->local_working_dir);
if(retval != -1)
if(bytes_read != -1)
printf("\r Downloaded %zd bytes OK!\n\r",bytes_read);
else
printf("\r\n Download FAILED!\n\r");

View File

@@ -28,6 +28,12 @@
int
mfshell_cmd_help(mfshell_t *mfshell, int argc, char **argv)
{
(void)argv;
if (argc != 1) {
fprintf(stderr, "Invalid number of arguments\n");
return -1;
}
printf(
" arguments:\n\r"
" <optional>\n\r"
@@ -35,8 +41,8 @@ mfshell_cmd_help(mfshell_t *mfshell, int argc, char **argv)
printf("\n\r");
int column1_width = 0;
int column2_width = 0;
unsigned int column1_width = 0;
unsigned int column2_width = 0;
_cmd_t* curr_cmd;
for (curr_cmd = mfshell->commands; curr_cmd->name != NULL; curr_cmd++) {

View File

@@ -53,6 +53,9 @@ mfshell_cmd_links(mfshell_t *mfshell, int argc, char **argv)
file = file_alloc();
retval = mfconn_api_file_get_links(mfshell->mfconn,file,(char*)quickkey);
if (retval != 0) {
fprintf(stderr, "api call unsuccessful\n");
}
mfconn_update_secret_key(mfshell->mfconn);
share_link = file_get_share_link(file);

View File

@@ -29,6 +29,7 @@
int
mfshell_cmd_list(mfshell_t *mfshell, int argc, char **argv)
{
(void)argv;
int retval;
const char *folder_curr;

View File

@@ -29,6 +29,7 @@
int
mfshell_cmd_lpwd(mfshell_t *mfshell, int argc, char **argv)
{
(void)argv;
if(mfshell == NULL) return -1;
if (argc != 1) {

View File

@@ -29,6 +29,7 @@
int
mfshell_cmd_pwd(mfshell_t *mfshell, int argc, char **argv)
{
(void)argv;
const char *folder_name;
char *folder_name_tmp = NULL;

View File

@@ -29,6 +29,7 @@
int
mfshell_cmd_whoami(mfshell_t *mfshell, int argc, char **argv)
{
(void)argv;
int retval;
if (argc != 1) {