From: Christian Franke Date: Wed, 29 May 2019 12:44:07 +0000 (+0200) Subject: isisd: Remove unnecessary use of strcpy X-Git-Tag: base_7.2~297^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=5627d3fec22062eea359345d2605bbb421bf5c0f;p=matthieu%2Ffrr.git isisd: Remove unnecessary use of strcpy `strcpy` is a dangerous function and should not be used. In this particular place, there is no need for copying strings at all, so let's just stick to referencing static strings. Signed-off-by: Christian Franke --- diff --git a/isisd/isisd.c b/isisd/isisd.c index 0b7d44ea1c..bee3b6deb5 100644 --- a/isisd/isisd.c +++ b/isisd/isisd.c @@ -738,11 +738,7 @@ DEFUN (clear_isis_neighbor_arg, */ void print_debug(struct vty *vty, int flags, int onoff) { - char onoffs[4]; - if (onoff) - strcpy(onoffs, "on"); - else - strcpy(onoffs, "off"); + const char *onoffs = onoff ? "on" : "off"; if (flags & DEBUG_ADJ_PACKETS) vty_out(vty,