if (vector_slot (v, i))
strsize += strlen ((char *) vector_slot (v, i)) + 1;
+ if (strsize == 0)
+ return XSTRDUP (MTYPE_TMP, "");
+
char *concatenated = calloc (sizeof (char), strsize);
for (unsigned int i = 0; i < vector_active (v); i++)
{
child = vector_slot (node->to, i);
size_t j;
struct cmd_token *token = child->data;
- if (!token->allowrepeat)
+ if (!token->allowrepeat && stack)
{
for (j = 0; j < stackpos; j++)
if (child == stack[j])
/* Print the name of the protocol */
if (zlog_default)
+ {
vty_out (vty, "%s", zlog_proto_names[zlog_default->protocol]);
- if (zlog_default->instance)
- vty_out (vty, " %d", zlog_default->instance);
+ if (zlog_default->instance)
+ vty_out (vty, " %d", zlog_default->instance);
+ }
vty_out (vty, ":%s", VTY_NEWLINE);
for (index = map->head; index; index = index->next)
struct route_map_index *index = VTY_GET_CONTEXT (route_map_index);
const char *rmap = argv[idx_word]->arg;
- if (index)
+ assert(index);
+
+ if (index->nextrm)
{
- if (index->nextrm)
- {
- route_map_upd8_dependency (RMAP_EVENT_CALL_DELETED,
- index->nextrm,
- index->map->name);
- XFREE (MTYPE_ROUTE_MAP_NAME, index->nextrm);
- }
- index->nextrm = XSTRDUP (MTYPE_ROUTE_MAP_NAME, rmap);
+ route_map_upd8_dependency (RMAP_EVENT_CALL_DELETED,
+ index->nextrm,
+ index->map->name);
+ XFREE (MTYPE_ROUTE_MAP_NAME, index->nextrm);
}
+ index->nextrm = XSTRDUP (MTYPE_ROUTE_MAP_NAME, rmap);
/* Execute event hook. */
route_map_upd8_dependency (RMAP_EVENT_CALL_ADDED,