[Geotiff] Two versions of CSVGetField

Derrick J Brashear shadow at dementia.org
Thu Oct 6 13:17:16 PDT 2005


On Thu, 6 Oct 2005, John Johnson wrote:

> For some reason libtiff has two versions of CSVGetField.
>
> The one in cpl_csv.c appears to do a teeny bit more than the one in
> cpl_csv_incode.c.
> The one in cpl_csv.c returns "" when it can't find a matching record. While
> the one in cpl_csv_incode.c returns NULL.
>
> There are a bunch of places in the code that do something like
> 'atoi(CSVGetField(...))' which promptly SEGV's if CSVGetFeild returns NULL.
> Which leads me to believe that the code is expecting to call the one that
> returns "". But my builds are calling the one that returns NULL.
>
>
> So my questions are: Why are there two versions? Which is supposed to be
> called from which context?

I contributed the incode version. It has probably bitrotted a bit. The 
intent was for portable binaries where you didn't want to also have to 
distribute a directory of helper files, you'd build against a static 
libgeotiff with incode epsg tables, so, you'd have a single static binary 
and no other files.

It's selected by a configure-time switch



More information about the Geotiff mailing list