]> git.puffer.fish Git - mirror/frr.git/commitdiff
isisd: Remove unnecessary use of strcpy 4414/head
authorChristian Franke <chris@opensourcerouting.org>
Wed, 29 May 2019 12:44:07 +0000 (14:44 +0200)
committerChristian Franke <chris@opensourcerouting.org>
Wed, 29 May 2019 12:45:10 +0000 (14:45 +0200)
`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 <chris@opensourcerouting.org>
isisd/isisd.c

index 0b7d44ea1c1a3d248e6c2e604d03430e5ade2c11..bee3b6deb56e5dbb401c75c6f3d525fbf5ab6850 100644 (file)
@@ -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,