scc

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

commit 69d169d3fa91fbc66fe2bef9610b43393069c9c8
parent 9ac16f7a1c84641109ea15c4a7c7dca8c489bff9
Author: Quentin Rameau <quinq@fifth.space>
Date:   Mon,  7 Oct 2019 22:46:36 +0200

[cc] Finalize temporary buffer in path()

Diffstat:
Msrc/cmd/cc/posix/cc.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/cmd/cc/posix/cc.c b/src/cmd/cc/posix/cc.c @@ -113,8 +113,10 @@ path(char *s) cnt += len; } - if (cnt != FILENAME_MAX) + if (cnt < FILENAME_MAX) { + buff[cnt] = '\0'; return xstrdup(buff); + } too_long: die("cc: too long pathname");