scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 67327320b7553450ecf3eb824b3dbec3d7dea096
parent 2350346b3eabce2f9bfcc7f1b12e0bb980edf591
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Sat,  1 Jul 2017 10:06:31 +0200

[cc1] Change memcpy to memmove in setloc()

Setloc() is called with the same string when macros are expanded,
and it means that memcpy is called with src = dst.

Diffstat:
Mcc1/lex.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cc1/lex.c b/cc1/lex.c @@ -77,7 +77,7 @@ setloc(char *fname, unsigned line) if ((len = strlen(fname)) >= FILENAME_MAX) die("file name too long: '%s'", fname); - memcpy(filenam, fname, len); + memmove(filenam, fname, len); filenam[len] = '\0'; free(input->filenam);