Skip to content

Commit

Permalink
report failed reads
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.osgeo.org/gdal/trunk@3395 f0d54148-0727-0410-94bb-9a71ac55c965
  • Loading branch information
warmerdam committed Jul 19, 2002
1 parent 7cd306b commit b7ed1f3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion frmts/bsb/bsb2raw.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
******************************************************************************
*
* $Log$
* Revision 1.2 2002/07/19 20:32:41 warmerda
* report failed reads
*
* Revision 1.1 2001/12/08 04:35:16 warmerda
* New
*
Expand All @@ -51,6 +54,7 @@ int main( int nArgc, char **papszArgv )
int iLine, i;
GByte *pabyScanline;
FILE *fp;
int nError = 0;

if( nArgc < 3 )
{
Expand All @@ -72,12 +76,18 @@ int main( int nArgc, char **papszArgv )
pabyScanline = (GByte *) CPLMalloc(psInfo->nXSize);
for( iLine = 0; iLine < psInfo->nYSize; iLine++ )
{
BSBReadScanline( psInfo, iLine, pabyScanline );
if( !BSBReadScanline( psInfo, iLine, pabyScanline ) )
nError++;

VSIFWrite( pabyScanline, 1, psInfo->nXSize, fp );
}

VSIFClose( fp );

if( nError > 0 )
fprintf( stderr, "Read failed for %d scanlines out of %d.\n",
nError, psInfo->nYSize );

/* -------------------------------------------------------------------- */
/* Write .aux file. */
/* -------------------------------------------------------------------- */
Expand Down

0 comments on commit b7ed1f3

Please sign in to comment.