From 3b18f1b87f07c0c9feee15c00c5debba00a2e012 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Klitzing?= Date: Thu, 3 Jun 2021 00:11:41 +0200 Subject: [PATCH] Use size_t for length parameter (#1799) --- esphome/core/preferences.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/esphome/core/preferences.cpp b/esphome/core/preferences.cpp index 8b41cbc7b5..2d58fc9efb 100644 --- a/esphome/core/preferences.cpp +++ b/esphome/core/preferences.cpp @@ -252,9 +252,9 @@ bool ESPPreferenceObject::load_internal_() { char key[32]; sprintf(key, "%u", this->offset_); - uint32_t len = (this->length_words_ + 1) * 4; + size_t len = (this->length_words_ + 1) * 4; - uint32_t actual_len; + size_t actual_len; esp_err_t err = nvs_get_blob(global_preferences.nvs_handle_, key, nullptr, &actual_len); if (err) { ESP_LOGV(TAG, "nvs_get_blob('%s'): %s - the key might not be set yet", key, esp_err_to_name(err));