Merge pull request #429 from marckleinebudde/cangen-fix

cangen: parse_dataoptarg(): avoid loop initial declaration
pull/430/head
Marc Kleine-Budde 2023-04-30 20:12:45 +02:00 committed by GitHub
commit 28a9a6c42f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -417,9 +417,10 @@ static int parse_dataoptarg(char *dataoptarg, unsigned char *rand_position)
{ {
int mode_format_selected = MODE_FIX; int mode_format_selected = MODE_FIX;
int arglen = strlen(dataoptarg); int arglen = strlen(dataoptarg);
int i;
/* Mark nibbles with * as fuzzable */ /* Mark nibbles with * as fuzzable */
for (int i = 0; i < CANFD_MAX_DLEN && i < arglen / 2; i++) { for (i = 0; i < CANFD_MAX_DLEN && i < arglen / 2; i++) {
if (optarg[2 * i] == CHAR_RANDOM) { if (optarg[2 * i] == CHAR_RANDOM) {
optarg[2 * i] = '0'; optarg[2 * i] = '0';
rand_position[i] += NIBBLE_H; rand_position[i] += NIBBLE_H;