From 09b1b40e4f77362e19f45ee3ac650474c4825fef Mon Sep 17 00:00:00 2001 From: Frank Warmerdam Date: Tue, 11 Sep 2007 20:16:33 +0000 Subject: 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 --- src/nad_init.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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; } -- cgit v1.2.3