aboutsummaryrefslogtreecommitdiffstats
path: root/alloca.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2010-07-16 11:58:26 +0300
committerArnold D. Robbins <arnold@skeeve.com>2010-07-16 11:58:26 +0300
commit765c7494b3dac62207e6cd57fb839997e237f292 (patch)
treef7da12ffdb85d9f82671cb3122775b2ce73f7ad9 /alloca.c
parentcce5115e21db1702e0617afdca36633e7e2c9eae (diff)
downloadegawk-765c7494b3dac62207e6cd57fb839997e237f292.tar.gz
egawk-765c7494b3dac62207e6cd57fb839997e237f292.tar.bz2
egawk-765c7494b3dac62207e6cd57fb839997e237f292.zip
Moving to 2.13.2.
Diffstat (limited to 'alloca.c')
-rw-r--r--alloca.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/alloca.c b/alloca.c
index d825b4b6..c29fbda3 100644
--- a/alloca.c
+++ b/alloca.c
@@ -42,10 +42,10 @@ you
lose
-- must know STACK_DIRECTION at compile-time
#endif /* STACK_DIRECTION undefined */
-#endif /* static */
-#endif /* emacs */
+#endif static
+#endif emacs
-#ifdef X3J11
+#ifdef __STDC__
typedef void *pointer; /* generic pointer type */
#else
typedef char *pointer; /* generic pointer type */
@@ -189,17 +189,16 @@ alloca (size) /* returns pointer to storage */
}
}
-pointer xmalloc(n)
-unsigned int n;
-{
- extern pointer malloc();
- pointer cp;
- static char mesg[] = "xmalloc: no memory!\n";
-
- cp = malloc(n);
- if (! cp) {
- write (2, mesg, sizeof(mesg) - 1);
- exit(1);
- }
- return cp;
+pointer
+xmalloc(n)
+int n;
+{
+ char *malloc();
+ char *p = malloc(n);
+
+ if (p)
+ return (p);
+
+ write(2, "fatal: out of memory!\n", 22);
+ exit(1);
}