I shall not use alloca() within loops
I shall not use alloca() within loops
I shall not use alloca() within loops
I shall not use alloca() within loops
...
size_t l;
FOREACH_WORD(word, l, value, state) {
size_t l;
FOREACH_WORD(word, l, value, state) {
- devlink = strndupa(word, l);
+ strncpy(devlink, word, l);
+ devlink[l] = '\0';
r = device_add_devlink(device, devlink);
if (r < 0)
r = device_add_devlink(device, devlink);
if (r < 0)
size_t l;
FOREACH_WORD_SEPARATOR(word, l, value, ":", state) {
size_t l;
FOREACH_WORD_SEPARATOR(word, l, value, ":", state) {
- tag = strndupa(word, l);
+ (void)strncpy(tag, word, l);
+ tag[l] = '\0';
r = device_add_tag(device, tag);
if (r < 0)
r = device_add_tag(device, tag);
if (r < 0)