diff options
| author | Howard Butler <howard@hobu.co> | 2015-10-21 16:54:30 -0500 |
|---|---|---|
| committer | Howard Butler <howard@hobu.co> | 2015-10-21 16:54:30 -0500 |
| commit | 16c5bde4ec0ecc324a282d8049f8df4070ef8a4b (patch) | |
| tree | cf81bf4b9477497e2f7abd81dd734e920f07dd6b | |
| parent | 1906ed3c70d1cf3474add6909b30276a5b0d7c8c (diff) | |
| download | PROJ-16c5bde4ec0ecc324a282d8049f8df4070ef8a4b.tar.gz PROJ-16c5bde4ec0ecc324a282d8049f8df4070ef8a4b.zip | |
Don't fail when reading small GTX files #269
| -rw-r--r-- | src/pj_gridinfo.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/pj_gridinfo.c b/src/pj_gridinfo.c index d7390847..958396ae 100644 --- a/src/pj_gridinfo.c +++ b/src/pj_gridinfo.c @@ -858,14 +858,10 @@ PJ_GRIDINFO *pj_gridinfo_init( projCtx ctx, const char *gridname ) /* -------------------------------------------------------------------- */ if( pj_ctx_fread( ctx, header, sizeof(header), 1, fp ) != 1 ) { - pj_ctx_fclose( ctx, fp ); - pj_ctx_set_errno( ctx, -38 ); - return gilist; + /* some files may be smaller that sizeof(header), eg 160, so */ + ctx->last_errno = 0; /* don't treat as a persistent error */ } - /* 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 ); /* -------------------------------------------------------------------- */ |
