HardenedBSD/contrib/libf2c/libF77/F77_aloc.c

25 lines
441 B
C
Raw Normal View History

1999-09-18 12:51:31 +02:00
#include "f2c.h"
#undef abs
#undef min
#undef max
#include <stdio.h>
static integer memfailure = 3;
#include <stdlib.h>
2003-07-11 05:42:19 +02:00
extern void G77_exit_0 (integer *);
1999-09-18 12:51:31 +02:00
2003-07-11 05:42:19 +02:00
char *
F77_aloc (integer Len, char *whence)
1999-09-18 12:51:31 +02:00
{
2003-07-11 05:42:19 +02:00
char *rv;
unsigned int uLen = (unsigned int) Len; /* for K&R C */
1999-09-18 12:51:31 +02:00
2003-07-11 05:42:19 +02:00
if (!(rv = (char *) malloc (uLen)))
{
fprintf (stderr, "malloc(%u) failure in %s\n", uLen, whence);
G77_exit_0 (&memfailure);
}
return rv;
}