Ticket #663 (closed patch: fixed)

Opened 18 months ago

Last modified 3 months ago

shp2pgsql uses the wrong return type for pgis_getopt

Reported by: ssinger Owned by: pramsey
Priority: medium Milestone: PostGIS 1.5.4
Component: loader/dumper Version: 1.5.X
Keywords: Cc:

Description

pgis_getopt is defined to return an int (like a normal getopt).

However in shp2pgsql-cli and -gui the value is being stored as a char.

The compiler then promotes this char back to an int to compare with EOF. The promotion of a char to an int with respect to negative numbers differs based on hardware platform. On powerpc the ((char)-1) != -1

If we store the result of pgis_getopt as an int we avoid this issue.

Patch attached.

Attachments

getopt_return.diff Download (0.6 KB) - added by ssinger 18 months ago.
patch to fix the bug

Change History

Changed 18 months ago by ssinger

patch to fix the bug

Changed 14 months ago by jadams

Fixed on trunk in revision 6935. Not fixed on 1.5 yet.

Changed 14 months ago by strk

  • component changed from postgis to loader/dumper

Changed 12 months ago by robe

  • milestone changed from PostGIS 1.5.3 to PostGIS 2.0.0

Changed 4 months ago by pramsey

  • milestone changed from PostGIS 2.0.0 to PostGIS 1.5.4

Changed 3 months ago by pramsey

  • status changed from new to closed
  • resolution set to fixed

r9206 in 1.5 branch

Note: See TracTickets for help on using tickets.