From bdbfe2715370760c31065270d5a180a44b89a969 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 30 Aug 2010 20:17:34 +0000 Subject: [PATCH] src/svf/svf_bison.y: Avoid further overhead by using memcpy() with all known lengths rather than strcpy(). git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1841 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 3 +++ urjtag/src/svf/svf_bison.y | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index 5f903378..aeb7e7ca 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -21,6 +21,9 @@ strcat(). This avoids having to rescan for the end of the string. Fix by Frans Meulenbroeks. + * src/svf/svf_bison.y: Avoid further overhead by using memcpy() with all + known lengths rather than strcpy(). + 2010-08-26 Mike Frysinger * src/tap/cable/gpio.c: Rewrite to use raw file descriptors when working with diff --git a/urjtag/src/svf/svf_bison.y b/urjtag/src/svf/svf_bison.y index 92aacc21..10f34a82 100644 --- a/urjtag/src/svf/svf_bison.y +++ b/urjtag/src/svf/svf_bison.y @@ -312,7 +312,7 @@ hexa_num_sequence $1.buflen = newlen; } if ($1.buf != NULL) { - strcpy ($1.buf + $1.strlen, $2); + memcpy ($1.buf + $1.strlen, $2, frag_len + 1); $1.strlen += frag_len; } free ($2);