diff --git a/mbtk/libmbtk_lib/ftp/mbtk_ftp.c b/mbtk/libmbtk_lib/ftp/mbtk_ftp.c
index f485ec7..69208d6 100755
--- a/mbtk/libmbtk_lib/ftp/mbtk_ftp.c
+++ b/mbtk/libmbtk_lib/ftp/mbtk_ftp.c
@@ -6,12 +6,14 @@
  Date:
  2020/10/28 11:49:08
  *************************************************************/
+#include <ctype.h>
+
 #include "mbtk_ftp.h"
 #include "mbtk_list.h"
 #include "mbtk_sock.h"
 #include "mbtk_str.h"
 #include "mbtk_sock2.h"
-#include<linux/msg.h>
+#include <linux/msg.h>
 
 /*************************************************************
  Constants and Macros
@@ -105,12 +107,12 @@
     return ptr;
 }
 
-static int ftp_cmd_handle(mbtk_ftp_info_s *info, const void *cmd, void *rsp,
+static int ftp_cmd_handle(mbtk_ftp_info_s *info, void *cmd, void *rsp,
                           uint32 *rsp_len)
 {
     int err;
     int rsp_code;
-    int len = strlen((char*) cmd);
+    unsigned int len = strlen((char*) cmd);
     // Write cmd
     if(info->auth_type != 0)
     {
@@ -144,13 +146,13 @@
             {
                 printf("\n mbtk_sock_read error:%d \n",err);
             }
-            rsp_code = atoi(mbtk_ftp_ssl_read_buf);
+            rsp_code = atoi((char*)mbtk_ftp_ssl_read_buf);
             printf("%s -> Code:%d; RSP:%s\n", (char*)cmd, rsp_code, (char* )mbtk_ftp_ssl_read_buf);
             if (rsp_code == 0)
             {
                 goto read_angin_1;
             }
-            memcpy((char* )rsp, mbtk_ftp_ssl_read_buf, strlen(mbtk_ftp_ssl_read_buf));
+            memcpy((char* )rsp, mbtk_ftp_ssl_read_buf, strlen((char*)mbtk_ftp_ssl_read_buf));
             //printf("\nrsp = %s\n",(char* )rsp);
             return rsp_code;
         }
@@ -182,7 +184,7 @@
         memset(buff, 0x0, 1024);
         if(info->auth_type != 0)
         {
-            unsigned char mbtk_ftp_ssl_read_buf[16384 + 1];
+            char mbtk_ftp_ssl_read_buf[16384 + 1];
             len = mbtk_sock_read(info->ftp_ssl_handle,info->session,mbtk_ftp_ssl_read_buf,sizeof(mbtk_ftp_ssl_read_buf),FTP_TIMEOUT,&err);
             if(err != 0)
             {
@@ -190,9 +192,8 @@
             }
             rsp_code = atoi(mbtk_ftp_ssl_read_buf);
             printf("%s -> Code:%d; RSP:%s\n", (char*)cmd, rsp_code, (char* )mbtk_ftp_ssl_read_buf);
-            char *mbtk_ftp_ssl_read_buf_p = NULL;
-            mbtk_ftp_ssl_read_buf_p = strstr(mbtk_ftp_ssl_read_buf,"\n");
-            if(mbtk_ftp_ssl_read_buf_p!=NULL);
+            char *mbtk_ftp_ssl_read_buf_p = strstr(mbtk_ftp_ssl_read_buf,"\n");
+            if(mbtk_ftp_ssl_read_buf_p!=NULL)
             {
                 if(strlen(mbtk_ftp_ssl_read_buf_p)>1)
                 {
@@ -374,7 +375,7 @@
     }
 
     // Get IPv4 and port
-    uint8 *ptr = rsp + 4;
+    char *ptr = (char*)rsp + 4;
     while (*ptr)
     {
         if (isdigit(*ptr))
@@ -383,7 +384,7 @@
     }
     // ptr point to first digit.
     memcpy(sock->host, ptr, strlen((char*) ptr));
-    ptr = sock->host;
+    ptr = (char*)(sock->host);
     int count = 0;
     while (*ptr)
     {
@@ -601,7 +602,7 @@
             if (strlen(name) > 0)
             {
                 LOGV("Name:%s",name);
-                memset(file_ptr.name,0,strlen(file_ptr.name)+1);
+                memset(file_ptr.name,0,strlen((char*)(file_ptr.name))+1);
                 memcpy(file_ptr.name, name, strlen(name));
                 char *temp = (char*) file_ptr.name
                              + strlen((char*) file_ptr.name) - 1;
@@ -682,7 +683,7 @@
             if (strlen(name) > 0)
             {
                 LOGV("Name:%s",name);
-                memset(file_ptr.name,0,strlen(file_ptr.name)+1);
+                memset(file_ptr.name,0,strlen((char*)file_ptr.name)+1);
                 memcpy(file_ptr.name, name, strlen(name));
                 char *temp = (char*) file_ptr.name
                              + strlen((char*) file_ptr.name) - 1;
@@ -930,8 +931,8 @@
             info->ftp_sock_ssl_info_data->ftp_ssl_support=1;
             info->ftp_sock_ssl_info_data->port = sock.port;
             info->ftp_sock_ssl_info_data->type = MBTK_SOCK_TCP;
-            info->ftp_sock_ssl_info_data->ingnore_cert = ~(info->sock_info[FTP_SOCK_CTRL].use_cert);
-            memcpy(info->ftp_sock_ssl_info_data->address, sock.host, strlen(sock.host));
+            info->ftp_sock_ssl_info_data->ingnore_cert = !(info->sock_info[FTP_SOCK_CTRL].use_cert);
+            memcpy(info->ftp_sock_ssl_info_data->address, sock.host, strlen((char*)sock.host));
             if(info->ftp_sock_ssl_info_data->is_support_ssl != 0)
             {
                 info->ftp_sock_ssl_info_data->is_support_ssl = 0;
@@ -1015,12 +1016,12 @@
 
     if (cmd == FTP_CMD_GET)   // Is download
     {
-        char cmd[100];
+        char cmd[200];
         if (info->file_trans.size_send > 0)   // Resume transmission
         {
             // REST size
-            memset(cmd, 0x0, 100);
-            snprintf(cmd, 100, "REST %ld\r\n", info->file_trans.size_send);
+            memset(cmd, 0x0, sizeof(cmd));
+            snprintf(cmd, sizeof(cmd), "REST %d\r\n", info->file_trans.size_send);
             code = ftp_cmd_handle(info, cmd, NULL, NULL);
             if (code != 350)
             {
@@ -1030,8 +1031,8 @@
             }
         }
 
-        memset(cmd, 0x0, 100);
-        snprintf(cmd, 100, "RETR %s\r\n", info->file_trans.remote_name);
+        memset(cmd, 0x0, sizeof(cmd));
+        snprintf(cmd, sizeof(cmd), "RETR %s\r\n", info->file_trans.remote_name);
         code = ftp_cmd_handle(info, cmd, NULL, NULL);
         if (code != 125 && code != 150)
         {
@@ -1072,9 +1073,9 @@
         if(info->auth_type != 0)
         {
                 int mbtk_errno;
-                char cmd[100];
-                memset(cmd, 0x0, 100);
-                snprintf(cmd, 100, "STOR %s\r\n", info->file_trans.remote_name);
+                char cmd[200];
+                memset(cmd, 0x0, sizeof(cmd));
+                snprintf(cmd, sizeof(cmd), "STOR %s\r\n", info->file_trans.remote_name);
         		LOGE("STOR %s .name:%s ", cmd, info->file_trans.remote_name);
                 code = ftp_cmd_handle(info, cmd, NULL, NULL);
                 if (code != 125 && code != 150)
@@ -1106,9 +1107,9 @@
         }
         else
         {
-            char cmd[100];
-            memset(cmd, 0x0, 100);
-            snprintf(cmd, 100, "STOR %s\r\n", info->file_trans.remote_name);
+            char cmd[200];
+            memset(cmd, 0x0, sizeof(cmd));
+            snprintf(cmd, sizeof(cmd), "STOR %s\r\n", info->file_trans.remote_name);
     		LOGE("STOR %s .name:%s ", cmd, info->file_trans.remote_name);
             code = ftp_cmd_handle(info, cmd, NULL, NULL);
             if (code != 125 && code != 150)
@@ -1827,7 +1828,7 @@
     info->file_trans.size_count = 0;
     info->file_trans.size_send = 0;
 
-    char line_buf[1024];
+//    char line_buf[1024];
     if(info->auth_type != 0)
         len = mbtk_sock_read(info->ftp_ssl_handle,info->session,buff,sizeof(buff),FTP_TIMEOUT,&err);
     else
@@ -2212,7 +2213,7 @@
                 unsigned char mbtk_ftp_ssl_read_buf[16384 + 1];
                 char cmd[50];
                 memset(cmd,0,50);
-                int len_ssl;
+//                int len_ssl;
 
 
                 memset(cmd,0,50);
@@ -2272,7 +2273,7 @@
                             &mbtk_errno);
                 printf("\nmbtk_sock_read PASS:\n%s\n",mbtk_ftp_ssl_read_buf);
                 char *ptr = NULL;
-                if((ptr = strstr(mbtk_ftp_ssl_read_buf,"220 ")) || (ptr = strstr(mbtk_ftp_ssl_read_buf,"230 "))) {
+                if((ptr = strstr((char*)mbtk_ftp_ssl_read_buf,"220 ")) || (ptr = strstr((char*)mbtk_ftp_ssl_read_buf,"230 "))) {
                     LOGI("RSP:%s",ptr);
                     printf("RSP:%s\n",ptr);
                 }
@@ -2375,16 +2376,16 @@
                                     int *port,int iptype)
 {
     char psz_port_cmd[128];
-    int i=0;
+//    int i=0;
 
     *port = rand() % (60000 - 50000 + 1) + 50000;
     sprintf(psz_port_cmd, "netstat -an | grep :%d > /dev/null", *port);
 
-        char ipBuf[32] = "";
+        char ipBuf[1024] = {0};
         FILE *fstream=NULL;
 
-        char buff[1024];
-        char iptype_str[8];
+        char buff[1024] = {0};
+//        char iptype_str[8];
         memset(buff,0,sizeof(buff));
         /*eth0可以换成eth1、docker0、em1、lo等*/
         if(iptype == MBTK_ADDR_IPV6)
@@ -2396,7 +2397,7 @@
             }
             if(NULL!=fgets(buff, sizeof(buff), fstream))
             {
-                snprintf(ipBuf, 39, "%s",buff);
+                snprintf(ipBuf, sizeof(buff), "%s",buff);
             }
             else
             {
@@ -2412,7 +2413,7 @@
             }
             if(NULL!=fgets(buff, sizeof(buff), fstream))
             {
-                snprintf(ipBuf, 18, "%s",buff);
+                snprintf(ipBuf, sizeof(ipBuf), "%s",buff);
             }
             else
             {
diff --git a/mbtk/libmbtk_lib/ftp/mbtk_ftp_at.c b/mbtk/libmbtk_lib/ftp/mbtk_ftp_at.c
index 3541e2b..958b0d0 100755
--- a/mbtk/libmbtk_lib/ftp/mbtk_ftp_at.c
+++ b/mbtk/libmbtk_lib/ftp/mbtk_ftp_at.c
@@ -11,7 +11,7 @@
 #include "mbtk_sock.h"
 #include "mbtk_str.h"
 #include "mbtk_sock2.h"
-#include<linux/msg.h>
+#include <sys/msg.h>
 
 /*************************************************************
  typedef struct:local at
@@ -38,7 +38,7 @@
 /*************************************************************
  Variables:local
  *************************************************************/
-static list_node_t *ftp_client_list = NULL;
+// static list_node_t *ftp_client_list = NULL;
 
 /*************************************************************
  Variables:public
@@ -328,7 +328,7 @@
 void mbtk_at_ftp_data_cb(void *data, uint32 data_len)
 {
     char resp_buf[2150];
-    printf("\n=====data_cb data[%s]=====\n=====data_cb data_len[%d]=====\n",data, data_len);
+    printf("\n=====data_cb data[%s]=====\n=====data_cb data_len[%d]=====\n",(char*)data, data_len);
 
     memset(resp_buf,0,2150);
     sprintf(resp_buf, "+CFTPGET:");
@@ -370,7 +370,7 @@
 {
 
     int at_ftp_ret=-1;
-    int len_size;
+//    int len_size;
 
     mbtk_at_ftp_par_at.at_ftp_handle = mbtk_ftp_init(mbtk_at_ftp_par_at.host, mbtk_at_ftp_par_at.port, mbtk_at_ftp_par_at.auth_type,
                                     0, mbtk_at_ftp_par_at.use_cert);
@@ -399,7 +399,7 @@
     uint32 len;
     int download_time = 0;
     char resp_buf[1024];
-    int ret;
+//    int ret;
 
     uint32 file_size = mbtk_ftp_file_size(mbtk_at_ftp_par_at.at_ftp_handle, remote_path);
     if(file_size > 0)
@@ -510,7 +510,7 @@
 
 void ftp_ls_at_cb_func(void *file_list_cb)
 {
-    int ret;
+//    int ret;
     char resp_buf[1024 + 1];
     printf("+CFTPLIST:\r\n%s\n", ((mbtk_ftp_file_info_s *)file_list_cb)->name);
     sprintf(resp_buf, "%s",((mbtk_ftp_file_info_s *)file_list_cb)->name);
@@ -522,7 +522,7 @@
 int mbtk_at_ftp_list(char *ftp_path)
 {
     int at_ftp_ret=-1;
-    int len_size;
+//    int len_size;
     char resp_buf[1024];
 
     mbtk_at_ftp_par_at.at_ftp_handle = mbtk_ftp_init(mbtk_at_ftp_par_at.host, mbtk_at_ftp_par_at.port, mbtk_at_ftp_par_at.auth_type,
