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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user