Just copying th const char* of the xpath means that if we
are enqueing multiple changes from a buffer, the last xpath
addedd will overwrite all of the previous references.
Copying the xpath to a buffer simplifies the API when
retrofitting the commands.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
}
change = &vty->cfg_changes[vty->num_cfg_changes++];
- change->xpath = xpath;
+ strlcpy(change->xpath, xpath, sizeof(change->xpath));
change->operation = operation;
change->value = value;
}
};
struct vty_cfg_change {
- const char *xpath;
+ char xpath[XPATH_MAXLEN];
enum nb_operation operation;
const char *value;
};