esp_local_ctrl: remove "Wno-format" cflag and fix formatting errors

This commit is contained in:
Mahavir Jain 2022-12-21 11:34:13 +05:30
parent 035c2e5799
commit b709c84e1c
No known key found for this signature in database
GPG Key ID: 99324EF4A00734E0
2 changed files with 3 additions and 4 deletions

View File

@ -24,5 +24,3 @@ idf_component_register(SRCS "${srcs}"
PRIV_REQUIRES protobuf-c)
idf_component_optional_requires(PRIVATE espressif__mdns mdns)
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <string.h>
#include <inttypes.h>
#include <esp_err.h>
#include <esp_log.h>
@ -355,7 +356,7 @@ esp_err_t esp_local_ctrl_get_prop_values(size_t total_indices, uint32_t *indices
/* Convert indices to names */
for (size_t i = 0; i < total_indices; i++) {
if (indices[i] >= local_ctrl_inst_ctx->props_count) {
ESP_LOGE(TAG, "Invalid property index %d", indices[i]);
ESP_LOGE(TAG, "Invalid property index %" PRId32, indices[i]);
return ESP_ERR_INVALID_ARG;
}
props[i].name = local_ctrl_inst_ctx->props[indices[i]]->name;
@ -396,7 +397,7 @@ esp_err_t esp_local_ctrl_set_prop_values(size_t total_indices, uint32_t *indices
}
for (size_t i = 0; i < total_indices; i++) {
if (indices[i] >= local_ctrl_inst_ctx->props_count) {
ESP_LOGE(TAG, "Invalid property index %d", indices[i]);
ESP_LOGE(TAG, "Invalid property index %" PRId32, indices[i]);
free(props);
return ESP_ERR_INVALID_ARG;
}