]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fix string handling in inputs completing in birdc clean-bsd-warnings
authorPavel Tvrdík <pawel.tvrdik@gmail.com>
Mon, 2 Nov 2015 15:52:16 +0000 (16:52 +0100)
committerPavel Tvrdík <pawel.tvrdik@gmail.com>
Mon, 2 Nov 2015 15:54:15 +0000 (16:54 +0100)
Thanks to Martin Mares for notice

client/commands.c

index 41baae1516e23d28eec7ba2f7882599e7d2ee247..0510e5114ca10e301fca5c60aaec1b6a42094718 100644 (file)
@@ -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;
        }