[postgis-users] 1.3.3 Pre-Release Notice

Paul Ramsey pramsey at cleverelephant.ca
Wed Apr 9 08:23:18 PDT 2008


>  if ( sr_id && strcmp(sr_id,"-1") ) printf("SRID=%s;", sr_id);
>
>  I have a very strong feeling that evaluation order in C is unspecified, rather
>  than being from left to right; so for example the compiler could decide to
>  generate code that evaluates the strcmp() first, in which case it would
>  segfault on a NULL :( I think you would need to re-write something like this:

Should be fine: man -S7 operator

>  if (sr_id)
>         if (strcmp(sr_id,"-1") ) printf("SRID=%s;", sr_id);
>
>  (looks even closer...)

>  In fact, why is sr_id stored as a string anyway? We should make sr_id an
>  integer with a default value of -1, and then use sscanf() within the switch()
>  statement of pgis_getopt() to read its value.

I'll have a look at that, how is the estimated_extent investigation coming?



More information about the postgis-users mailing list