Skip to content

Commit

Permalink
fix: 解决luat_ota.c的编译警告
Browse files Browse the repository at this point in the history
  • Loading branch information
wendal committed May 13, 2024
1 parent 10cb27a commit 2f29fef
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions luat/modules/luat_ota.c
Expand Up @@ -71,7 +71,7 @@ int luat_ota_checkfile(const char* path) {
return -1;
}

unsigned int len = 0;
size_t len = 0;
int remain = binsize - 16;

luat_md5_init(&ota->context);
Expand All @@ -89,7 +89,7 @@ int luat_ota_checkfile(const char* path) {
if (len == 0) { // 不可能的事
break;
}
if (len < 0 || len > 512) {
if (len > 512) {
luat_heap_free(ota);
luat_fs_fclose(fd);
LLOGE("read file fail");
Expand All @@ -99,7 +99,7 @@ int luat_ota_checkfile(const char* path) {
remain -= len;
luat_md5_update(&ota->context, ota->buff, len);
}
luat_md5_finalize(&ota->context, &ota->digest);
luat_md5_finalize(&ota->context, ota->digest.bytes);
#ifdef LUAT_USE_CRYPTO
mbedtls_md5_free(&ota->context);
#endif
Expand Down

0 comments on commit 2f29fef

Please sign in to comment.