mirror of
https://github.com/openharmony/applications_sample_camera.git
synced 2026-07-19 21:26:10 -04:00
修改setting/setting/src/main/cpp/wpa_work.c文件,消除文件路径字符串过长告警
删除strcpy和strcat函数,用字符串便利替代,消除文件路径字符串过长告警 Signed-off-by: tongkai0808fh <tongkai5@huawei.com>
This commit is contained in:
@@ -15,7 +15,6 @@
|
||||
|
||||
#include "wpa_work.h"
|
||||
#include <sys/prctl.h>
|
||||
#include <string.h>
|
||||
|
||||
#define WPA_IFACE_NAME "wlan0"
|
||||
#define WIFI_AUTH_FAILED_REASON_STR "WRONG_KEY"
|
||||
@@ -486,11 +485,13 @@ static void *ThreadMain()
|
||||
int i = 0;
|
||||
int myfor = 5;
|
||||
char *arg[20] = {0};
|
||||
char argstr1[] = "/storage/app/run/com.huawei.setting/setting/assets";
|
||||
char argstr2[] = "/setting/resources/base/element/wpa_supplicant.conf";
|
||||
string argstr1 = "/storage/app/run/com.huawei.setting/setting/assets";
|
||||
string argstr2 = "/setting/resources/base/element/wpa_supplicant.conf";
|
||||
char argstr[120];
|
||||
strcpy_s(argstr, strlen(argstr1) + 1, argstr1);
|
||||
strcat_s(argstr, strlen(argstr2) + 1, argstr2);
|
||||
string argstr3 = argstr1 + argstr2;
|
||||
for (int i = 0; i < argstr3.length(); ++i) {
|
||||
argstr[i] = argstr3[i];
|
||||
}
|
||||
arg[i] = (char *)"wpa_supplicant";
|
||||
arg[++i] = (char *)"-i";
|
||||
arg[++i] = (char *)"wlan0";
|
||||
|
||||
Reference in New Issue
Block a user