summaryrefslogtreecommitdiff
path: root/lib/command.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-07-14 13:18:14 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-07-14 13:18:14 +0200
commit28b672fcd33f328964c91f0a3d06cd904bddad42 (patch)
tree1cc622db26c12def1bd038813c6dda77d021c06b /lib/command.c
parent84a98309def99b23c86de42ea8228d9191b65772 (diff)
lib, vtysh: remove now-useless newline arg
It's always \n now, hooray. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/command.c')
-rw-r--r--lib/command.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/command.c b/lib/command.c
index 454f0957c5..6d304fc12b 100644
--- a/lib/command.c
+++ b/lib/command.c
@@ -718,13 +718,12 @@ cmd_variable_complete (struct cmd_token *token, const char *arg, vector comps)
#define AUTOCOMP_INDENT 5
char *
-cmd_variable_comp2str(vector comps, unsigned short cols, const char nl[])
+cmd_variable_comp2str(vector comps, unsigned short cols)
{
size_t bsz = 16;
char *buf = XCALLOC(MTYPE_TMP, bsz);
int lc = AUTOCOMP_INDENT;
size_t cs = AUTOCOMP_INDENT;
- size_t nllen = strlen(nl);
size_t itemlen;
snprintf(buf, bsz, "%*s", AUTOCOMP_INDENT, "");
for (size_t j = 0; j < vector_active (comps); j++)
@@ -732,12 +731,12 @@ cmd_variable_comp2str(vector comps, unsigned short cols, const char nl[])
char *item = vector_slot (comps, j);
itemlen = strlen(item);
- if (cs + itemlen + nllen + AUTOCOMP_INDENT + 2 >= bsz)
+ if (cs + itemlen + AUTOCOMP_INDENT + 3 >= bsz)
buf = XREALLOC(MTYPE_TMP, buf, (bsz *= 2));
if (lc + itemlen + 1 >= cols)
{
- cs += snprintf(&buf[cs], bsz - cs, "%s%*s", nl, AUTOCOMP_INDENT, "");
+ cs += snprintf(&buf[cs], bsz - cs, "\n%*s", AUTOCOMP_INDENT, "");
lc = AUTOCOMP_INDENT;
}