framework: Fixed a error in file path.
Fixed error due to sizeof.
@@ -1255,7 +1255,6 @@ static int parse_things_info_json(const char *filename)
} else {
return 0;
}
-
cJSON *file_path = cJSON_GetObjectItem(configuration, KEY_CONFIGURATION_FILEPATH);
if (NULL != file_path) {
cJSON *svrdb = cJSON_GetObjectItem(file_path, KEY_CONFIGURATION_FILEPATH_SVRDB);
@@ -1272,7 +1271,7 @@ static int parse_things_info_json(const char *filename)
memset(g_certificate_file_path, 0, (size_t)MAX_FILE_PATH_LENGTH + 1);
memset(g_private_key_file_path, 0, (size_t)MAX_FILE_PATH_LENGTH + 1);
- if (strncmp(svrdb->valuestring, PATH_MNT, sizeof(PATH_MNT)) == 0) {
+ if (strncmp(svrdb->valuestring, "/", 1) == 0) {
if (strlen(svrdb->valuestring) > (size_t)MAX_FILE_PATH_LENGTH) {
THINGS_LOG_V_ERROR(THINGS_ERROR, TAG, "svrdb file path length exceeded");
return 0;
@@ -1287,7 +1286,7 @@ static int parse_things_info_json(const char *filename)
strcat(g_svrdb_file_path, svrdb->valuestring);
}
- if (strncmp(provisioning->valuestring, PATH_MNT, sizeof(PATH_MNT)) == 0) {
+ if (strncmp(provisioning->valuestring, "/", 1) == 0) {
if (strlen(provisioning->valuestring) > (size_t)MAX_CLOUD_ADDRESS) {
THINGS_LOG_V_ERROR(THINGS_ERROR, TAG, "provisioning file path length exceeded");
return 0;
@@ -1302,7 +1301,7 @@ static int parse_things_info_json(const char *filename)
strcat(g_things_cloud_file_path, provisioning->valuestring);
}
- if (strncmp(certificate->valuestring, PATH_ROM, sizeof(PATH_ROM)) == 0) {
+ if (strncmp(certificate->valuestring, "/", 1) == 0) {
if (strlen(certificate->valuestring) > (size_t)MAX_FILE_PATH_LENGTH) {
THINGS_LOG_V_ERROR(THINGS_ERROR, TAG, "certificate file path length exceeded");
return 0;
@@ -1317,7 +1316,7 @@ static int parse_things_info_json(const char *filename)
strcat(g_certificate_file_path, certificate->valuestring);
}
- if (strncmp(privateKey->valuestring, PATH_ROM, sizeof(PATH_ROM)) == 0) {
+ if (strncmp(privateKey->valuestring, "/", 1) == 0) {
if (strlen(privateKey->valuestring) > (size_t)MAX_FILE_PATH_LENGTH) {
THINGS_LOG_V_ERROR(THINGS_ERROR, TAG, "privateKey file path length exceeded");
return 0;
