chore(tests): replace sprintf -> lv_snprintf (#5319)

Signed-off-by: pengyiqiang <pengyiqiang@xiaomi.com>
Co-authored-by: pengyiqiang <pengyiqiang@xiaomi.com>
This commit is contained in:
_VIFEXTech
2024-01-15 19:20:04 +08:00
committed by GitHub
parent 751bc99b98
commit e0be0c9253
3 changed files with 10 additions and 8 deletions

View File

@@ -129,7 +129,7 @@ static bool screenhot_compare(const char * fn_ref, const char * mode, uint8_t to
{
char fn_ref_full[256];
sprintf(fn_ref_full, "%s%s", REF_IMGS_PATH, fn_ref);
lv_snprintf(fn_ref_full, sizeof(fn_ref_full), "%s%s", REF_IMGS_PATH, fn_ref);
lv_refr_now(NULL);
@@ -191,7 +191,7 @@ static bool screenhot_compare(const char * fn_ref, const char * mode, uint8_t to
fn_ref_no_ext[strlen(fn_ref_no_ext) - 4] = '\0';
char fn_err_full[256];
sprintf(fn_err_full, "%s%s_err.png", REF_IMGS_PATH, fn_ref_no_ext);
lv_snprintf(fn_err_full, sizeof(fn_err_full), "%s%s_err.png", REF_IMGS_PATH, fn_ref_no_ext);
write_png_file(screen_buf_xrgb8888, 800, 480, fn_err_full);
}