Skip to content

Commit

Permalink
isisd: Remove unnecessary use of strcpy
Browse files Browse the repository at this point in the history
`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>
  • Loading branch information
cfra committed May 29, 2019
1 parent 637b00c commit 5627d3f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions isisd/isisd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5627d3f

Please sign in to comment.