You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ma...@apache.org on 2015/11/26 00:56:27 UTC

[2/7] incubator-mynewt-larva git commit: Return from _sbrk is -1 on failure, not 0.

Return from _sbrk is -1 on failure, not 0.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/commit/7ede884f
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/tree/7ede884f
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/diff/7ede884f

Branch: refs/heads/master
Commit: 7ede884fbedc3f13d049ce9d3c003f3e70aeff7d
Parents: 4fb0b66
Author: Marko Kiiskila <ma...@runtime.io>
Authored: Wed Nov 25 15:44:07 2015 -0800
Committer: Marko Kiiskila <ma...@runtime.io>
Committed: Wed Nov 25 15:44:07 2015 -0800

----------------------------------------------------------------------
 libs/baselibc/src/malloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-larva/blob/7ede884f/libs/baselibc/src/malloc.c
----------------------------------------------------------------------
diff --git a/libs/baselibc/src/malloc.c b/libs/baselibc/src/malloc.c
index 1d56de4..3ef5089 100644
--- a/libs/baselibc/src/malloc.c
+++ b/libs/baselibc/src/malloc.c
@@ -169,7 +169,7 @@ retry_alloc:
 	}
         if (result == NULL) {
             more_mem = _sbrk(size);
-            if (more_mem) {
+            if (more_mem != (void *)-1) {
                 add_malloc_block(more_mem, size);
                 goto retry_alloc;
             }