aboutsummaryrefslogtreecommitdiff
path: root/src/nad_init.c
diff options
context:
space:
mode:
authorFrank Warmerdam <warmerdam@pobox.com>2007-09-11 20:16:33 +0000
committerFrank Warmerdam <warmerdam@pobox.com>2007-09-11 20:16:33 +0000
commit09b1b40e4f77362e19f45ee3ac650474c4825fef (patch)
tree69b9a4f716c9b2feb7e7c683c3a5a647b35b94e8 /src/nad_init.c
parentf488c2246ada3eaeee371c2dabe3ccc467583874 (diff)
downloadPROJ-09b1b40e4f77362e19f45ee3ac650474c4825fef.tar.gz
PROJ-09b1b40e4f77362e19f45ee3ac650474c4825fef.zip
Improve error recovery if ctable datum shift files fails to load.
git-svn-id: http://svn.osgeo.org/metacrs/proj/trunk@1402 4e78687f-474d-0410-85f9-8d5e500ac6b2
Diffstat (limited to 'src/nad_init.c')
-rw-r--r--src/nad_init.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/nad_init.c b/src/nad_init.c
index 936bada5..ccf68a17 100644
--- a/src/nad_init.c
+++ b/src/nad_init.c
@@ -28,6 +28,9 @@
******************************************************************************
*
* $Log$
+ * Revision 1.10 2007/09/11 20:16:33 fwarmerdam
+ * Improve error recovery if ctable datum shift files fails to load.
+ *
* Revision 1.9 2006/11/17 22:16:30 mloskot
* Uploaded PROJ.4 port for Windows CE.
*
@@ -87,6 +90,15 @@ int nad_ctable_load( struct CTABLE *ct, FILE *fid )
if( ct->cvs == NULL
|| fread(ct->cvs, sizeof(FLP), a_size, fid) != a_size )
{
+ pj_dalloc( ct->cvs );
+ ct->cvs = NULL;
+
+ if( getenv("PROJ_DEBUG") != NULL )
+ {
+ fprintf( stderr,
+ "ctable loading failed on fread() - binary incompatible?\n" );
+ }
+
pj_errno = -38;
return 0;
}