From: DXY <1731678236@qq.com> Date: Mon, 6 May 2024 02:12:06 +0000 (+0800) Subject: 还原文件修改bug X-Git-Tag: release_V1.2.70_20241020_135402~1108^2~22 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=629cdb8490cc95d9801163553bbeec1e00141d38;p=mirrors%2FFD230.git 还原文件修改bug --- diff --git a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp old mode 100755 new mode 100644 index 366c2a0cf..476463ee1 --- a/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp +++ b/code/sdk/application/wearable/service/msg_center/src/msg_center_customer.cpp @@ -380,14 +380,21 @@ void MsgCenterNotifyCardProc(const Topic topic, Request* req) //green,red,ir int green,red,ir; char* str= (char *)req->data; + char *pchStrTmpIn = NULL; WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",str); char *tokbuf=NULL; - tokbuf=strtok(str,","); + tokbuf=strtok_r(str,",",&pchStrTmpIn); + if(tokbuf!=NULL) green=atoi(tokbuf); - tokbuf=strtok(NULL,","); - red=atoi(tokbuf); - tokbuf=strtok(NULL,"\0"); + + tokbuf=strtok_r(NULL,",",&pchStrTmpIn); + if(tokbuf!=NULL) + red=atoi(tokbuf); + + tokbuf=strtok_r(NULL,"\0",&pchStrTmpIn); + if(tokbuf!=NULL) ir=atoi(tokbuf); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d,%d,%d",green,red,ir); testhrsenson1View * t= testhrsenson1View::GetInstance(); @@ -406,14 +413,23 @@ void MsgCenterNotifyleaklightProc(const Topic topic, Request* req) //green,red,ir int green,red,ir; char* str= (char *)req->data; + char *pchStrTmpIn = NULL; + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%s",str); + char *tokbuf=NULL; - tokbuf=strtok(str,","); + tokbuf=strtok_r(str,",",&pchStrTmpIn); + if(tokbuf!=NULL) green=atoi(tokbuf); - tokbuf=strtok(NULL,","); - red=atoi(tokbuf); - tokbuf=strtok(NULL,"\0"); + + tokbuf=strtok_r(NULL,",",&pchStrTmpIn); + if(tokbuf!=NULL) + red=atoi(tokbuf); + + tokbuf=strtok_r(NULL,"\0",&pchStrTmpIn); + if(tokbuf!=NULL) ir=atoi(tokbuf); + WEARABLE_LOGE(WEARABLE_LOG_MODULE_APP, "%d,%d,%d",green,red,ir); testhrsenson1View * t= testhrsenson1View::GetInstance();