From: Pavel TvrdĂ­k Date: Mon, 2 Nov 2015 15:52:16 +0000 (+0100) Subject: Fix string handling in inputs completing in birdc X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fclean-bsd-warnings;p=thirdparty%2Fbird.git Fix string handling in inputs completing in birdc Thanks to Martin Mares for notice --- diff --git a/client/commands.c b/client/commands.c index 41baae151..0510e5114 100644 --- a/client/commands.c +++ b/client/commands.c @@ -195,7 +195,7 @@ cmd_find_common_match(struct cmd_node *root, char *cmd, int len, int *pcount, ch (*pcount)++; if (best < 0) { - strncpy(buf, m->token + len, BIRDC_INPUT_COMPLETE_BUFFER_LEN); + strlcpy(buf, m->token + len, BIRDC_INPUT_COMPLETE_BUFFER_LEN); best = m->len - len; best_prio = m->prio; }