gengxin
author@CHENG <2393524978@qq.com>
Mon, 24 Jun 2024 09:53:52 +0000 (17:53 +0800)
committer@CHENG <2393524978@qq.com>
Mon, 24 Jun 2024 09:53:52 +0000 (17:53 +0800)
2.sdk/sdk/gui/lv_watch/mmi_protocol/mmi_protocol_fzd.c

index 0d22206..415776e 100644 (file)
@@ -190,7 +190,7 @@ void * mmi_protocol_fzd_send_space_init(MMI_PROTOCOL_FZD_ACTION_ENUM action, int
         return NULL;
     }
 
-       s_send_space_struct[action].ptr = (void *)lv_mem_alloc(size);
+       s_send_space_struct[action].ptr = (void *)lv_mem_alloc(size + 1);
        if(NULL == s_send_space_struct[action].ptr)
        {
                PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: \n", __FUNCTION__, __LINE__, action);
@@ -198,6 +198,7 @@ void * mmi_protocol_fzd_send_space_init(MMI_PROTOCOL_FZD_ACTION_ENUM action, int
                s_send_space_struct[action].size = 0;
                return NULL;
        }
+       _lv_memset_00(s_send_space_struct[action].ptr, (size + 1));
        s_send_space_struct[action].size = size;
 
        PROTOCOL_DEBUG_PRINTF("[@CHENG_DEBUG][%s][%d]: ptr=0x%x\n", __FUNCTION__, __LINE__, s_send_space_struct[action].ptr);