Making sure that string gets NULL terminated in benchmark_radio.cc when using strncpy. Fixes compiler warning in GCC 8.2

master
Pedro Alvarez 6 years ago committed by Andre Puschmann
parent 63852c5b87
commit a18196cdc2

@ -95,13 +95,16 @@ void parse_args(int argc, char **argv) {
file_pattern = argv[optind];
break;
case 'a':
strncpy(radios_args[0], argv[optind], 64);
strncpy(radios_args[0], argv[optind], 63);
radios_args[0][63] = '\0';
break;
case 'b':
strncpy(radios_args[1], argv[optind], 64);
strncpy(radios_args[1], argv[optind], 63);
radios_args[1][63] = '\0';
break;
case 'c':
strncpy(radios_args[2], argv[optind], 64);
strncpy(radios_args[2], argv[optind], 63);
radios_args[2][63] = '\0';
break;
case 'r':
nof_radios = (uint32_t)atoi(argv[optind]);

Loading…
Cancel
Save