Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-02-02 07:32:02 +0300
committerChristopher Faylor <me@cgf.cx>2001-02-02 07:32:02 +0300
commit47f810920afff067666bd6496a3c92e92e2d65a8 (patch)
tree98328ee09b593859c980d4d394ab5fa61b240a6f /winsup/cygwin/cygheap.cc
parentb5139f598bf64bdb3212375a6ee6907dfbeacea0 (diff)
* cygheap.cc (creturn): Correctly calculate cygheap_max.
Diffstat (limited to 'winsup/cygwin/cygheap.cc')
-rw-r--r--winsup/cygwin/cygheap.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc
index 49a819a65..585ca8aa8 100644
--- a/winsup/cygwin/cygheap.cc
+++ b/winsup/cygwin/cygheap.cc
@@ -202,8 +202,9 @@ creturn (cygheap_types x, cygheap_entry * c, int len)
return NULL;
}
c->type = x;
- if (cygheap_max < ((char *) c + len))
- cygheap_max = (char *) c + len;
+ char *cend = ((char *) c + sizeof (*c) + len);
+ if (cygheap_max < cend)
+ cygheap_max = cend;
MALLOC_CHECK;
return (void *) c->data;
}