[postgis-devel] [PostGIS] #1668: ST_AsText, ST_AsEWKT under Windows 64-bit PostGIS 64-bit is all screwy

PostGIS trac at osgeo.org
Fri Mar 9 09:29:07 PST 2012


#1668: ST_AsText, ST_AsEWKT under Windows 64-bit PostGIS 64-bit is all screwy
---------------------+------------------------------------------------------
 Reporter:  robe     |       Owner:  pramsey      
     Type:  defect   |      Status:  new          
 Priority:  high     |   Milestone:  PostGIS 2.0.0
Component:  postgis  |     Version:  trunk        
 Keywords:  mingw64  |  
---------------------+------------------------------------------------------

Comment(by pramsey):

 Can you provide the exact patch you have made? The one you outline in your
 first comment makes no sense, the one in your second I can kind fo see,
 particularly if the behaviour of vsnprintf is variable (though we don't
 see this on win32!!!!).

 Regarding the practice we don't know how much space a string will take
 until vsnprintf is called, so we need to depend on the return value of the
 function. I think rather than over-riding the return, if the msoft
 behaviour is in fact to return a negaitve errcode on an over-long write,
 we just need to test for "either more space than we have or a negative
 error code" on the first call to the function and everything should work
 fine. If there's a legitimate error, it'll recur inside that block and we
 cna return on it. If the error is due to a lack of space, we'll have
 expanded the buffer and everything will work the second time.

-- 
Ticket URL: <http://trac.osgeo.org/postgis/ticket/1668#comment:15>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-devel mailing list