*
**********************************************************************
* $Log$
+ * Revision 1.42 2003/12/01 14:27:58 strk
+ * added simple malloc wrapper
+ *
* Revision 1.41 2003/09/29 16:15:22 pramsey
* Patch from strk:
* - "\t" always preceeded the first value of a dump_format query
DBFHandle hDBFHandle);
char *protect_quotes_string(char *str);
int PIP( Point P, Point* V, int n );
+void *safe_malloc(size_t size);
+
+void *safe_malloc(size_t size)
+{
+ void *ret = malloc(size);
+ if ( ! ret ) {
+ fprintf(stderr, "Out of virtual memory\n");
+ exit(1);
+ }
+ return ret;
+}
+
+#define malloc(x) safe_malloc(x)
char *make_good_string(char *str){
hSHPHandle = SHPOpen( shp_file, "rb" );
hDBFHandle = DBFOpen( shp_file, "rb" );
if (hSHPHandle == NULL || hDBFHandle == NULL){
- printf ("shape is null\n");
+ fprintf(stderr, "shape is null\n");
exit(-1);
}