Skip to content

Commit f5f3fc3

Browse files
Copilotnetmindz
andcommitted
Fix: Cast min() arguments to size_t for ESP32-C3 compatibility
Co-authored-by: netmindz <442066+netmindz@users.noreply.github.com>
1 parent 042ed39 commit f5f3fc3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

wled00/wled_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static void calculateBootloaderSHA256() {
207207
uint8_t buffer[chunkSize];
208208

209209
for (uint32_t offset = 0; offset < bootloaderSize; offset += chunkSize) {
210-
size_t readSize = min(chunkSize, bootloaderSize - offset);
210+
size_t readSize = min((size_t)(bootloaderSize - offset), chunkSize);
211211
if (esp_flash_read(NULL, buffer, bootloaderOffset + offset, readSize) == ESP_OK) {
212212
mbedtls_sha256_update(&ctx, buffer, readSize);
213213
}

0 commit comments

Comments
 (0)