[Bugfix][T106BUG-575]fix the issue of ineffective whitelist addition
Only Configure: No
Affected branch: master
Affected module: NETWORK
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I1a76b306e2179b0e7af1638e6cbccc0c468143af
diff --git a/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c b/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
index bf5cca7..738af4f 100755
--- a/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
+++ b/ap/app/zte_comm/at_ctl/src/atconfig/mnet_whitelist.c
@@ -72,7 +72,9 @@
{
char* ptr=NULL;
int pos_start=0;
-
+/*add for fix whitelist fuction by lcz@20240402 start*/
+ int len = 0;
+/*add for fix whitelist fuction by lcz@20240402 end*/
if(0 == strlen(PsmIndAtCmdPrefix)){
if(strlen(cmd) > sizeof(PsmIndAtCmdPrefix)){
at_print(AT_ERR,"mnet_whitelist_add cmd too long\n");
@@ -94,7 +96,11 @@
}
if((strlen(PsmIndAtCmdPrefix) + strlen(cmd)) < sizeof(PsmIndAtCmdPrefix)){
- snprintf(PsmIndAtCmdPrefix, AT_CMD_MAX, "%s%s", PsmIndAtCmdPrefix, cmd);
+ /*add for fix whitelist fuction by lcz@20240402 start*/
+ len = strlen(PsmIndAtCmdPrefix);
+ snprintf(PsmIndAtCmdPrefix+len, AT_CMD_MAX-len, "%s", cmd);
+ //snprintf(PsmIndAtCmdPrefix, AT_CMD_MAX, "%s%s", PsmIndAtCmdPrefix, cmd);
+ /*add for fix whitelist fuction by lcz@20240402 end*/
return MNET_WHITELIST_OPER_SUCC;
}else{
at_print(AT_ERR,"no space left\n");