src/svf/svf_flex.l: Use memcpy() rather than strcpy() when we already know the length and we just want to dupe the string.

git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1838 b68d4a1b-bc3d-0410-92ed-d4ac073336b7
master
Mike Frysinger 15 years ago
parent 69b34c22ea
commit 95193fa86a

@ -11,6 +11,9 @@
* src/svf/svf_flex.l (fix_yylloc): Accept the string length from caller to
avoid useless overhead of calling strlen(). Fix by Frans Meulenbroeks.
* src/svf/svf_flex.l: Use memcpy() rather than strcpy() when we already know
the length and we just want to dupe the string.
2010-08-26 Mike Frysinger <vapier@gentoo.org>
* src/tap/cable/gpio.c: Rewrite to use raw file descriptors when working with

@ -149,7 +149,7 @@ COMMENT (!.*)|("//".*)[^\n]
len = align_string(yytext);
cstring = malloc(len + 1);
strcpy(cstring, yytext);
memcpy(cstring, yytext, len + 1);
yylval->cvalue = cstring;
return(VECTOR_STRING);
} /* end of vector string */
@ -172,7 +172,7 @@ COMMENT (!.*)|("//".*)[^\n]
len = align_string(yytext);
cstring = (char *)malloc(len + 1);
strcpy(cstring, yytext);
memcpy(cstring, yytext, len + 1);
yylval->cvalue = cstring;
return(HEXA_NUM_FRAGMENT);
} /* end of hexadecimal value */

Loading…
Cancel
Save