diff options
| author | Howard Butler <howard@hobu.co> | 2015-10-06 13:45:53 -0500 |
|---|---|---|
| committer | Howard Butler <howard@hobu.co> | 2015-10-06 13:45:53 -0500 |
| commit | 6eabf3c854f3786fbaa1b645ea9e9aae6e4522e4 (patch) | |
| tree | fbba9eab312ce07904f044c726e2543ced80cc49 /src | |
| parent | 8f0427b4e1fd66a9d7fca90389ce4be209a4f42f (diff) | |
| parent | 9c17a17ae1ce955f5e080e3174262b13351aec03 (diff) | |
| download | PROJ-6eabf3c854f3786fbaa1b645ea9e9aae6e4522e4.tar.gz PROJ-6eabf3c854f3786fbaa1b645ea9e9aae6e4522e4.zip | |
Merge pull request #315 from OSGeo/issues-269-gridinfo-ctx
avoid read failure for minimal GTX files #269
Diffstat (limited to 'src')
| -rw-r--r-- | src/pj_gridinfo.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pj_gridinfo.c b/src/pj_gridinfo.c index 3d34dd7e..d7390847 100644 --- a/src/pj_gridinfo.c +++ b/src/pj_gridinfo.c @@ -397,7 +397,7 @@ int pj_gridinfo_load( projCtx ctx, PJ_GRIDINFO *gi ) /* Seek a parent grid file by name from a grid list */ /************************************************************************/ -static PJ_GRIDINFO* pj_gridinfo_parent( PJ_GRIDINFO *gilist, +static PJ_GRIDINFO* pj_gridinfo_parent( PJ_GRIDINFO *gilist, const char *name, int length ) { while( gilist ) @@ -863,6 +863,9 @@ PJ_GRIDINFO *pj_gridinfo_init( projCtx ctx, const char *gridname ) return gilist; } + /* some files may be smaller that sizeof(header), eg 160, so */ + ctx->last_errno = 0; /* don't treat as a persistent error */ + pj_ctx_fseek( ctx, fp, SEEK_SET, 0 ); /* -------------------------------------------------------------------- */ |
