scc

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

commit ece53fd7cdacbcdf1c8b9c00da8ac05b6d7e52e4
parent 86238c282fee31458b60011ba411c6cd30017c3f
Author: Roberto E. Vargas Caballero <roberto@clue.aero>
Date:   Sat, 16 May 2020 20:14:14 +0200

Merge branch 'master' of ssh://simple-cc.org:/var/gitrepos/scc

Diffstat:
Msrc/libc/arch/amd64/linux/.gitignore | 1+
Msrc/libc/stdio/vfprintf.c | 3++-
Msrc/libc/syscall.h | 1+
3 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/libc/arch/amd64/linux/.gitignore b/src/libc/arch/amd64/linux/.gitignore @@ -9,3 +9,4 @@ _read.s _sigaction.s _sys_errlist.c _write.s +_unlink.s diff --git a/src/libc/stdio/vfprintf.c b/src/libc/stdio/vfprintf.c @@ -350,7 +350,8 @@ flags: goto wstrout; } else { s = va_arg(va2, char *); - len = strnlen(s, conv.prec); + if ((len = strlen(s)) > conv.prec) + len = conv.prec; goto strout; } wstrout: diff --git a/src/libc/syscall.h b/src/libc/syscall.h @@ -6,3 +6,4 @@ extern int _write(int fd, void *buf, size_t n); extern int _lseek(int fd, long off, int whence); extern void _Exit(int status); extern int _access(char *path, int mode); +extern int _unlink(const char *path);