mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 14:29:54 +02:00
Merge pull request #429 from marckleinebudde/cangen-fix
cangen: parse_dataoptarg(): avoid loop initial declaration
This commit is contained in:
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user