]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - lib/libF77/F77_aloc.c
Fix a couple of typos.
[FreeBSD/FreeBSD.git] / lib / libF77 / F77_aloc.c
1 #include "f2c.h"
2 #undef abs
3 #undef min
4 #undef max
5 #include "stdio.h"
6
7 static integer memfailure = 3;
8
9 #ifdef KR_headers
10 extern char *malloc();
11 extern void exit_();
12
13  char *
14 F77_aloc(Len, whence) integer Len; char *whence;
15 #else
16 #include "stdlib.h"
17 extern void exit_(integer*);
18
19  char *
20 F77_aloc(integer Len, char *whence)
21 #endif
22 {
23         char *rv;
24         unsigned int uLen = (unsigned int) Len; /* for K&R C */
25
26         if (!(rv = (char*)malloc(uLen))) {
27                 fprintf(stderr, "malloc(%u) failure in %s\n",
28                         uLen, whence);
29                 exit_(&memfailure);
30                 }
31         return rv;
32         }