summaryrefslogtreecommitdiff
path: root/code/fe310/gloss/sys_sbrk.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2020-03-07 05:05:00 +0100
committerUros Majstorovic <majstor@majstor.org>2020-03-07 05:05:00 +0100
commita0688d29102539f8bc0f5b412683bf3d899d85c0 (patch)
tree4a8d1d81d999dfec2a0b15e4811ddc92f674fbcc /code/fe310/gloss/sys_sbrk.c
parent69b151fc3564ffa7dc2ddaad495cfbf4a19dbb5d (diff)
fixed sbrk
Diffstat (limited to 'code/fe310/gloss/sys_sbrk.c')
-rw-r--r--code/fe310/gloss/sys_sbrk.c3
1 files changed, 1 insertions, 2 deletions
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;
}