strcpy explanations.
This commit is contained in:
parent
ec54baeef6
commit
d89191cd9e
|
|
@ -875,7 +875,7 @@ int ecrt_slave_config_flag(ec_slave_config_t *sc, const char *key,
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(io.key, key);
|
strcpy(io.key, key); // no strncpy, buffer is alloc'ed with strlen
|
||||||
io.value = value;
|
io.value = value;
|
||||||
|
|
||||||
ret = ioctl(sc->master->fd, EC_IOCTL_SC_FLAG, &io);
|
ret = ioctl(sc->master->fd, EC_IOCTL_SC_FLAG, &io);
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ int ec_flag_init(
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
strcpy(flag->key, key);
|
strcpy(flag->key, key); // no strncpy, buffer is alloc'ed with strlen
|
||||||
flag->value = value;
|
flag->value = value;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue