summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/vty.c16
-rw-r--r--lib/workqueue.c3
2 files changed, 11 insertions, 8 deletions
diff --git a/lib/vty.c b/lib/vty.c
index e9d1f2e323..073092dfb6 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -479,6 +479,8 @@ static int vty_command(struct vty *vty, char *buf)
const char *protocolname;
char *cp = NULL;
+ assert(vty);
+
/*
* Log non empty command lines
*/
@@ -496,13 +498,13 @@ static int vty_command(struct vty *vty, char *buf)
/* format the base vty info */
snprintf(vty_str, sizeof(vty_str), "vty[??]@%s", vty->address);
- if (vty)
- for (i = 0; i < vector_active(vtyvec); i++)
- if (vty == vector_slot(vtyvec, i)) {
- snprintf(vty_str, sizeof(vty_str),
- "vty[%d]@%s", i, vty->address);
- break;
- }
+
+ for (i = 0; i < vector_active(vtyvec); i++)
+ if (vty == vector_slot(vtyvec, i)) {
+ snprintf(vty_str, sizeof(vty_str), "vty[%d]@%s",
+ i, vty->address);
+ break;
+ }
/* format the prompt */
snprintf(prompt_str, sizeof(prompt_str), cmd_prompt(vty->node),
diff --git a/lib/workqueue.c b/lib/workqueue.c
index 1af51c06c1..39dd142afb 100644
--- a/lib/workqueue.c
+++ b/lib/workqueue.c
@@ -245,10 +245,11 @@ int work_queue_run(struct thread *thread)
char yielded = 0;
wq = THREAD_ARG(thread);
- wq->thread = NULL;
assert(wq);
+ wq->thread = NULL;
+
/* calculate cycle granularity:
* list iteration == 1 run
* listnode processing == 1 cycle