From 6e88ef26f9e086adbf28aa67ceeba2efd57d9ef2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 30 Aug 2010 20:15:22 +0000 Subject: [PATCH] src/svf/svf_bison.y: Use known string length to call strcpy() rather than strcat(). This avoids having to rescan for the end of the string. Fix by Frans Meulenbroeks. git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1840 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- urjtag/ChangeLog | 4 ++++ urjtag/src/svf/svf_bison.y | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/urjtag/ChangeLog b/urjtag/ChangeLog index cb62e87a..5f903378 100644 --- a/urjtag/ChangeLog +++ b/urjtag/ChangeLog @@ -17,6 +17,10 @@ * src/svf/svf_bison.y: Avoid calling strlen() multiple times on the same string. Fix by Frans Meulenbroeks. + * src/svf/svf_bison.y: Use known string length to call strcpy() rather than + strcat(). This avoids having to rescan for the end of the string. Fix by + Frans Meulenbroeks. + 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 979c5836..92aacc21 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) { - strcat ($1.buf, $2); + strcpy ($1.buf + $1.strlen, $2); $1.strlen += frag_len; } free ($2);