Skip to content

Commit

Permalink
Don't fail when reading small GTX files #269
Browse files Browse the repository at this point in the history
  • Loading branch information
hobu committed Oct 21, 2015
1 parent 1906ed3 commit 16c5bde
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/pj_gridinfo.c
Expand Up @@ -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 );

/* -------------------------------------------------------------------- */
Expand Down

0 comments on commit 16c5bde

Please sign in to comment.