mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
unify usage of memdup len operand
This commit is contained in:
parent
fd0c5f9558
commit
b138fdb93f
2 changed files with 5 additions and 5 deletions
|
@ -147,7 +147,7 @@ int hook_parse(config_setting_t *cfg, struct list *list)
|
|||
if (!plg)
|
||||
cerror(cfg, "Unknown hook function '%s'", name);
|
||||
|
||||
hook = memdup(&plg->hook, sizeof(struct hook));
|
||||
hook = memdup(&plg->hook, sizeof(plg->hook));
|
||||
hook->parameter = param;
|
||||
|
||||
list_push(list, hook);
|
||||
|
|
|
@ -201,7 +201,7 @@ static int ngsi_parse_mapping(struct list *mapping, config_setting_t *cfg)
|
|||
list_init(&map.metadata);
|
||||
struct ngsi_metadata meta;
|
||||
while (sscanf(token, " %m[^(](%m[^)])=%ms%n", &meta.name, &meta.type, &meta.value, &bytes) == 3) { INDENT
|
||||
list_push(&map.metadata, memdup(&meta, sizeof(struct ngsi_metadata)));
|
||||
list_push(&map.metadata, memdup(&meta, sizeof(meta)));
|
||||
token += bytes;
|
||||
}
|
||||
|
||||
|
@ -219,10 +219,10 @@ static int ngsi_parse_mapping(struct list *mapping, config_setting_t *cfg)
|
|||
};
|
||||
snprintf(index.value, 8, "%u", j);
|
||||
|
||||
list_push(&map.metadata, memdup(&index, sizeof(struct ngsi_metadata)));
|
||||
list_push(&map.metadata, memdup(&source, sizeof(struct ngsi_metadata)));
|
||||
list_push(&map.metadata, memdup(&index, sizeof(index)));
|
||||
list_push(&map.metadata, memdup(&source, sizeof(source)));
|
||||
|
||||
list_push(mapping, memdup(&map, sizeof(struct ngsi_attribute)));
|
||||
list_push(mapping, memdup(&map, sizeof(map)));
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue