/* some library functions used */
extern long atol();
extern char *mktemp();
-extern char *sbrk();
+extern char *malloc();
extern char *getenv();
/* ========== Machine dependent C declarations ========== */
static item_t *next;
if (--nleft < 0) {
- next = (item_t *) sbrk(MEMINCR);
- if ((int) next == -1)
+ next = (item_t *) malloc(MEMINCR);
+ if (next == 0)
fatal("out of memory");
nleft += (MEMINCR / sizeof(item_t));
}
static struct common_t *next;
if (--nleft < 0) {
- next = (struct common_t *) sbrk(MEMINCR);
- if ((int) next == -1) {
+ next = (struct common_t *) malloc(MEMINCR);
+ if (next == 0) {
fatal("out of memory");
}
nleft += (MEMINCR / sizeof (struct common_t));
n++;
while (*p++);
if ((nleft -= n) < 0) {
- next = sbrk(MEMINCR);
- if ((int) next == -1)
+ next = malloc(MEMINCR);
+ if (next == 0)
fatal("out of memory");
nleft = (MEMINCR / sizeof(char)) - n;
assert(nleft >= 0);