summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKwang Son <k.son@samsung.com>2021-01-05 13:23:31 +0900
committerKwang Son <k.son@samsung.com>2021-01-05 13:23:31 +0900
commit658b6c97dd2bc227e409466095837bb9d143292d (patch)
tree99312c3d234205eb1b2c9ee37bc3a46c2bc891a1
parentfeffbea62443053937b6d473aad10db467b33cb1 (diff)
downloadmediavision-658b6c97dd2bc227e409466095837bb9d143292d.tar.gz
mediavision-658b6c97dd2bc227e409466095837bb9d143292d.tar.bz2
mediavision-658b6c97dd2bc227e409466095837bb9d143292d.zip
Fix gcc warning
- printf formatting - sprintf truncation Change-Id: I2371d525fdbd665a413892993b95769ad16be0fd
-rw-r--r--test/testsuites/face/face_test_suite.c9
-rw-r--r--test/testsuites/inference/inference_test_suite.c14
2 files changed, 13 insertions, 10 deletions
diff --git a/test/testsuites/face/face_test_suite.c b/test/testsuites/face/face_test_suite.c
index f74b21c9..a4339f19 100644
--- a/test/testsuites/face/face_test_suite.c
+++ b/test/testsuites/face/face_test_suite.c
@@ -509,7 +509,7 @@ int perform_mv_face_recognition_model_add_face_example(
"choose images with only faces. I.e. face has to cover\n"
"approximately 95-100%% of the image (passport photos\n"
"are the best example :)). Note that if this value is\n"
- "less than 95%, accuracy can be significantly reduced.\n"
+ "less than 95%%, accuracy can be significantly reduced.\n"
"In real code such images can be achieved by cropping\n"
"faces from images with face detection functionality.\n"
TEXT_RESET);
@@ -1570,9 +1570,12 @@ void track_cb(
}
} else {
char out_file_name[FILE_PATH_SIZE];
- snprintf(out_file_name, FILE_PATH_SIZE, "%s_%03d.jpg",
+ if(snprintf(out_file_name, FILE_PATH_SIZE, "%s_%03d.jpg",
cb_data->out_file_path,
- cb_data->frame_number);
+ cb_data->frame_number) < 0)
+ {
+ printf("Output file name truncated.");
+ }
err = save_image_from_buffer(out_file_name, out_buffer, &image_data, 100);
if (MEDIA_VISION_ERROR_NONE != err) {
diff --git a/test/testsuites/inference/inference_test_suite.c b/test/testsuites/inference/inference_test_suite.c
index cc03f8c2..804c6185 100644
--- a/test/testsuites/inference/inference_test_suite.c
+++ b/test/testsuites/inference/inference_test_suite.c
@@ -1049,7 +1049,7 @@ int perform_image_classification()
if (MEDIA_VISION_ERROR_NONE != err) {
int err2 = mv_destroy_source(mvSource);
if (err2 != MEDIA_VISION_ERROR_NONE)
- printf("Fail to destroy mvSource.\n", err2);
+ printf("Fail to destroy mvSource. error code:%i\n", err2);
mvSource = NULL;
free(in_file_name);
break;
@@ -1103,7 +1103,7 @@ int perform_image_classification()
int do_another = 0;
if (err != MEDIA_VISION_ERROR_NONE) {
- printf("ERROR: Action is finished with error code: %i\n");
+ printf("ERROR: Action is finished with error code:%i\n", err);
}
sel_opt = 0;
@@ -1536,7 +1536,7 @@ int perform_object_detection()
int do_another = 0;
if (err != MEDIA_VISION_ERROR_NONE) {
- printf("ERROR: Action is finished with error code: %i\n");
+ printf("ERROR: Action is finished with error code:%i\n", err);
}
sel_opt = 0;
@@ -1897,7 +1897,7 @@ int perform_face_detection()
if (err != MEDIA_VISION_ERROR_NONE) {
int err2 = mv_destroy_source(mvSource);
if (err2 != MEDIA_VISION_ERROR_NONE)
- printf("Fail to destroy mvSource.\n", err2);
+ printf("Fail to destroy mvSource. error code:%i\n", err2);
mvSource = NULL;
free(in_file_name);
break;
@@ -1950,7 +1950,7 @@ int perform_face_detection()
int do_another = 0;
if (err != MEDIA_VISION_ERROR_NONE) {
- printf("ERROR: Action is finished with error code: %i\n");
+ printf("ERROR: Action is finished with error code:%i\n", err);
}
sel_opt = 0;
@@ -2227,7 +2227,7 @@ int perform_facial_landmark_detection()
if (err != MEDIA_VISION_ERROR_NONE) {
int err2 = mv_destroy_source(mvSource);
if (err2 != MEDIA_VISION_ERROR_NONE)
- printf("Fail to destroy mvSource.\n", err2);
+ printf("Fail to destroy mvSource. error code:%i\n", err2);
mvSource = NULL;
free(in_file_name);
break;
@@ -2280,7 +2280,7 @@ int perform_facial_landmark_detection()
int do_another = 0;
if (err != MEDIA_VISION_ERROR_NONE) {
- printf("ERROR: Action is finished with error code: %i\n");
+ printf("ERROR: Action is finished with error code:%i\n", err);
}
sel_opt = 0;