From 16c5bde4ec0ecc324a282d8049f8df4070ef8a4b Mon Sep 17 00:00:00 2001 From: Howard Butler Date: Wed, 21 Oct 2015 16:54:30 -0500 Subject: Don't fail when reading small GTX files #269 --- src/pj_gridinfo.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') 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 ); /* -------------------------------------------------------------------- */ -- cgit v1.2.3