David Fries suggestions. In image_to_j2k and j2k_to_image, strncpy() functions: instead of specifying the path size macro, let the compiler read the length out of the array entry.
This commit is contained in:
@@ -153,7 +153,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters)
|
||||
infile);
|
||||
return 1;
|
||||
}
|
||||
strncpy(parameters->infile, infile, OPJ_PATH_LEN);
|
||||
strncpy(parameters->infile, infile, sizeof(parameters->infile)-1);
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -172,7 +172,7 @@ int parse_cmdline_decoder(int argc, char **argv, opj_dparameters_t *parameters)
|
||||
fprintf(stderr, "Unknown output format image %s [only *.pnm, *.pgm, *.ppm, *.pgx or *.bmp]!! \n", outfile);
|
||||
return 1;
|
||||
}
|
||||
strncpy(parameters->outfile, outfile, OPJ_PATH_LEN);
|
||||
strncpy(parameters->outfile, outfile, sizeof(parameters->outfile)-1);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user