]> granicus.if.org Git - postgis/commitdiff
Correct fix for win32 crasher, it was proj returning a null error string.
authorPaul Ramsey <pramsey@cleverelephant.ca>
Sat, 25 Feb 2012 17:10:23 +0000 (17:10 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Sat, 25 Feb 2012 17:10:23 +0000 (17:10 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@9299 b70326c6-7e19-0410-871a-916f4a2858ee

libpgcommon/lwgeom_transform.c
regress/tickets_expected

index 2331d34d70b2a1b5b089fa37ed7e1c014057cde1..67953816ce6e4e0f1782ad0d74294c1ea8da45e7 100644 (file)
@@ -380,9 +380,7 @@ char* GetProj4StringSPI(int srid)
                }
                else
                {
-                       SPI_finish();
-                       pfree(proj_str);
-                       return NULL;
+                       proj_str[0] = 0;
                }
        }
        else
@@ -496,9 +494,13 @@ AddToPROJ4SRSCache(PROJ4PortalCache *PROJ4Cache, int srid, int other_srid)
        projection = lwproj_from_string(proj_str);
        if ( projection == NULL )
        {
+               char *pj_errstr = pj_strerrno(*pj_get_errno_ref());
+               if ( ! pj_errstr )
+                       pj_errstr = "";
+               
                elog(ERROR,
-                   "AddToPROJ4SRSCache: couldn't parse proj4 string: '%s': %s",
-                   proj_str, pj_strerrno(*pj_get_errno_ref()));
+                   "AddToPROJ4SRSCache: could not parse proj4 string '%s' %s",
+                   proj_str, pj_errstr);
        }
 
        /*
index 102e475e05ae3b45b9e7524e9727ab2adbcc428e..8e13d75ffc23291c0f77422d72ccecd19a173583 100644 (file)
@@ -190,7 +190,7 @@ ERROR:  MultiSurface cannot contain MultiPoint element at character 8
 #852.2|1|t|t
 #852.2|2|t|t
 #1489|MULTIPOINT EMPTY|0|MULTILINESTRING EMPTY|0|MULTIPOLYGON EMPTY|0|GEOMETRYCOLLECTION EMPTY|0
-ERROR:  GetProj4String returned NULL for SRID (500001)
+ERROR:  AddToPROJ4SRSCache: could not parse proj4 string '' 
 #1038|
 #1042|2
 #1398a|POINT(-119.093153 45.632669)