diff --git a/ql-application/threadx/interface/custom_app/mqtt.c b/ql-application/threadx/interface/custom_app/mqtt.c index f49d44c..2d91758 100644 --- a/ql-application/threadx/interface/custom_app/mqtt.c +++ b/ql-application/threadx/interface/custom_app/mqtt.c @@ -168,7 +168,7 @@ static int ota_state_save(const char *previous_version, const char *target_versi } ret = ql_fwrite(&state, sizeof(state), 1, fp); - if (ret != 1) { + if (ret != (int)sizeof(state)) { RLOGE("OTA state write failed: %d", ret); ql_fclose(fp); ql_remove(OTA_STATE_TMP_FILE); @@ -211,7 +211,7 @@ static int ota_state_load(ota_state_t *state) memset(state, 0, sizeof(*state)); ret = ql_fread(state, sizeof(*state), 1, fp); ql_fclose(fp); - if (ret != 1) { + if (ret != (int)sizeof(*state)) { RLOGE("OTA state read failed: %d", ret); return -1; }