mirror of
https://github.com/nyanmisaka/mpp.git
synced 2025-10-05 17:16:50 +08:00
[test]: Fix stringop-truncation warnings
Fix this warning when building with newer GCC: warning: '__builtin_strncpy' specified bound 256 equals destination size [-Wstringop-truncation] | 106 | return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest)); | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | In function 'strncpy', Change-Id: I6341fa4e507f644b143a8e266f3df267fbd9c566 Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
@@ -876,8 +876,7 @@ static RK_S32 mpi_enc_test_parse_options(int argc, char **argv, MpiEncTestCmd* c
|
||||
switch (*opt) {
|
||||
case 'i':
|
||||
if (next) {
|
||||
strncpy(cmd->file_input, next, MAX_FILE_NAME_LENGTH);
|
||||
cmd->file_input[strlen(next)] = '\0';
|
||||
strncpy(cmd->file_input, next, MAX_FILE_NAME_LENGTH - 1);
|
||||
cmd->have_input = 1;
|
||||
} else {
|
||||
mpp_err("input file is invalid\n");
|
||||
@@ -886,8 +885,7 @@ static RK_S32 mpi_enc_test_parse_options(int argc, char **argv, MpiEncTestCmd* c
|
||||
break;
|
||||
case 'o':
|
||||
if (next) {
|
||||
strncpy(cmd->file_output, next, MAX_FILE_NAME_LENGTH);
|
||||
cmd->file_output[strlen(next)] = '\0';
|
||||
strncpy(cmd->file_output, next, MAX_FILE_NAME_LENGTH - 1);
|
||||
cmd->have_output = 1;
|
||||
} else {
|
||||
mpp_log("output file is invalid\n");
|
||||
|
Reference in New Issue
Block a user