[Gdal-dev] Null-Pointer in GDALOpen?

Mateusz Loskot mateusz at loskot.net
Mon Oct 22 16:54:42 EDT 2007


Tom Kazimiers wrote:
> Hi again,
> 
> I figured out that the conversion of "\a.tif" leads to a
> missinterpretation in translation to char and therefore the strange
> symbol comes up.
> Not clear is why the function did not break in this case.

\a is interpreted a escape sequence, you need to use double backslash \\

> I traced a bit through the gdal-geotiff-opening process and figured out
> that everything works fine until this part
> in GDALDataset *GTiffDataset::Open( GDALOpenInfo * poOpenInfo ) in
> geotiff.cpp
> 
> /* -------------------------------------------------------------------- */
> /*      Try opening the dataset.                                        */
> /* -------------------------------------------------------------------- */
>     if( poOpenInfo->eAccess == GA_ReadOnly )
>     hTIFF = VSI_TIFFOpen( poOpenInfo->pszFilename, "r" );
>     else
>         hTIFF = VSI_TIFFOpen( poOpenInfo->pszFilename, "r+" );

Try to use double backslash and do not pass any wide-chars to GDALOpen.

Cheers
-- 
Mateusz Loskot
http://mateusz.loskot.net



More information about the Gdal-dev mailing list