From a63c319bddf5e4dd6d7724e4fbcf7c5ce0a24972 Mon Sep 17 00:00:00 2001 From: stnolting <22944758+stnolting@users.noreply.github.com> Date: Sat, 20 Aug 2022 17:36:38 +0200 Subject: [PATCH] [sw/lib] syscalls: minor fix --- sw/lib/source/syscalls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sw/lib/source/syscalls.c b/sw/lib/source/syscalls.c index 48b087fc..04252725 100644 --- a/sw/lib/source/syscalls.c +++ b/sw/lib/source/syscalls.c @@ -271,7 +271,7 @@ ssize_t _write(int file, const void *ptr, size_t len) extern char __heap_start[]; extern char __heap_end[]; -static char *brk = __heap_start; +static char *brk = &__heap_start[0]; int _brk(void *addr) { @@ -283,14 +283,14 @@ void *_sbrk(ptrdiff_t incr) { char *old_brk = brk; - if (__heap_start == __heap_end) { + if (&__heap_start[0] == &__heap_end[0]) { return NULL; } - if ((brk += incr) < __heap_end) { + if ((brk += incr) < &__heap_end[0]) { brk += incr; } else { - brk = __heap_end; + brk = &__heap_end[0]; } return old_brk; }