From a0688d29102539f8bc0f5b412683bf3d899d85c0 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Sat, 7 Mar 2020 05:05:00 +0100 Subject: fixed sbrk --- code/fe310/gloss/sys_sbrk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'code/fe310/gloss') diff --git a/code/fe310/gloss/sys_sbrk.c b/code/fe310/gloss/sys_sbrk.c index cc01c8f..ce10c90 100644 --- a/code/fe310/gloss/sys_sbrk.c +++ b/code/fe310/gloss/sys_sbrk.c @@ -28,10 +28,9 @@ _sbrk(ptrdiff_t incr) } /* Don't move the break past the end of the heap */ - if ((brk + incr) < &metal_segment_heap_target_end) { + if ((brk + incr) <= &metal_segment_heap_target_end) { brk += incr; } else { - brk = &metal_segment_heap_target_end; return (void *)-1; } -- cgit v1.2.3