From 6a0a8a9ee41c47aaafa094df692e2b42169e5e5e Mon Sep 17 00:00:00 2001 From: payton Date: Fri, 26 Jan 2024 09:55:01 +0800 Subject: [PATCH] =?UTF-8?q?1.=E4=BF=AE=E5=A4=8D=E6=97=A0emmc=E5=92=8Csd?= =?UTF-8?q?=E5=8D=A1=E6=97=A0=E6=B3=95=E8=BF=9E=E6=8E=A5WiFi=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sf_app/code/source/wifi/sf_wifi_svr.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c index 3a15f9661..6da65a06a 100755 --- a/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c +++ b/code/application/source/sf_app/code/source/wifi/sf_wifi_svr.c @@ -1161,12 +1161,7 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) // HI_MESSAGE_S stMessage; MLOGI(" s\n"); - char *strg_path = sf_get_root_path(); - if(strg_path == NULL) - { - free(strg_path); - return SF_FAILURE; - } + char *strg_path = NULL; UINT32 dcf_handle = 0; /* 0:emmc 1:sd */ //char *dcf_file = System_Get_DCF_Disk_Drive(dcf_handle) == SF_EMMC_DCF_HANDLE ? SF_EMMC_DCF_FILE_NAME : SF_SD_DCF_FILE_NAME; @@ -1966,7 +1961,16 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) } else { - sprintf((char *)fileName, "%s%s",strg_path,pMsgStruct->msgBuf.ctrlFileTransfer.fileName); + strg_path = sf_get_root_path(); + if(strg_path == NULL) + { + free(strg_path); + sprintf((char *)fileName, "%s%s",SF_EMMC_ROOT,pMsgStruct->msgBuf.ctrlFileTransfer.fileName); + } + else{ + sprintf((char *)fileName, "%s%s",strg_path,pMsgStruct->msgBuf.ctrlFileTransfer.fileName); + free(strg_path); + } } //MLOGI("rec file cmd:%s\n", fileName); } @@ -2330,7 +2334,6 @@ SINT32 sf_svr_packet_proc(SINT32 fd, UINT8 *pAppData, UINT16 dataLen) printf("offset=%d\n",offset); } } - free(strg_path); return ntohs(pMsgStruct->cmd); }