From b2a567277a7a8d9571a9abfa9617b3962a83b6a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Markus=20Fr=C3=B6schle?= Date: Sat, 17 Mar 2018 08:24:59 +0100 Subject: [PATCH] fix off-by-one error in memset() --- Makefile | 4 ++-- util/bas_sscanf.c | 0 util/bas_string.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 util/bas_sscanf.c diff --git a/Makefile b/Makefile index eb9465d..6bc933f 100644 --- a/Makefile +++ b/Makefile @@ -17,7 +17,7 @@ endif # can be either "Y" or "N" (without quotes). "Y" for using the m68k-elf-, "N" for using the m68k-atari-mint # toolchain -COMPILE_ELF=N +COMPILE_ELF=Y ifeq (Y,$(COMPILE_ELF)) TCPREFIX=m68k-elf- @@ -183,7 +183,7 @@ LIBBAS=libbas.a LIBS=$(patsubst %,%/$(LIBBAS),$(TRGTDIRS)) -all: ver fls ram bfl lib tos +all: ver fls ram bfl lib fls: $(patsubst %,%/$(FLASH_EXEC),$(TRGTDIRS)) ram: $(patsubst %,%/$(RAM_EXEC),$(TRGTDIRS)) bfl: $(patsubst %,%/$(BASFLASH_EXEC),$(TRGTDIRS)) diff --git a/util/bas_sscanf.c b/util/bas_sscanf.c new file mode 100644 index 0000000..e69de29 diff --git a/util/bas_string.c b/util/bas_string.c index c3333d3..63af107 100644 --- a/util/bas_string.c +++ b/util/bas_string.c @@ -59,7 +59,7 @@ void *memset(void *s, int c, size_t n) do { *dst++ = c; - } while (n--); + } while (--n); return s; }