Skip to content

Commit

Permalink
lib: don't use strcpy
Browse files Browse the repository at this point in the history
>:(

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
  • Loading branch information
qlyoung committed Apr 18, 2020
1 parent 96e4329 commit 1120b95
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/csv.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* CSV
* Copyright (C) 2013 Cumulus Networks, Inc.
* Copyright (C) 2013,2020 Cumulus Networks, Inc.
*
* This file is part of Quagga.
*
Expand All @@ -22,6 +22,8 @@
#include "config.h"
#endif

#include <zebra.h>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -419,7 +421,7 @@ void csv_clone_record(csv_t *csv, csv_record_t *in_rec, csv_record_t **out_rec)
}
rec->record = curr;
rec->rec_len = in_rec->rec_len;
strcpy(rec->record, in_rec->record);
strlcpy(rec->record, in_rec->record, csv->buflen);

/* decode record into fields */
csv_decode_record(rec);
Expand Down

0 comments on commit 1120b95

Please sign in to comment.