Bug report #1236

Invalid use of stream operator dxf2shp converter

Added by Mateusz Loskot - over 16 years ago. Updated over 16 years ago.

Status:Closed
Priority:Low
Assignee:nobody -
Category:C++ Plugins
Affected QGIS version: Regression?:No
Operating System:OS X Easy fix?:No
Pull Request or Patch supplied: Resolution:fixed
Crashes QGIS or corrupts data: Copied to github as #:11296

Description

logfile object below is of std::ostream type:

logfile << "(Add Circle  (%6.3f, %6.3f, %6.3f) %6.3f\
", data.cx, data.cy, data.cz, data.radius;

For ostream, printf-like formating is not defined, colon operator between data variables has no effect, so the statement above outputs this:

(Add Circle  (%6.3f, %6.3f, %6.3f) %6.3f

Generally, the logfile usage above does not make much sense.

BTW, it is really a bad idea to load the whole std namespace in a header file. using namespace std directive should never be used in a header file. See [source:trunk/qgis/src/plugins/dxf2shp_converter/builder.h@9036#L28 builder.h], line 28

Associated revisions

Revision 7703910f
Added by Jürgen Fischer over 16 years ago

dxf2shp cleanup (fixes #1236)

git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9132 c8812cc2-4d05-0410-92ff-de0c093fc19c

Revision 07c905b7
Added by Jürgen Fischer over 16 years ago

dxf2shp cleanup (fixes #1236)

git-svn-id: http://svn.osgeo.org/qgis/trunk@9132 c8812cc2-4d05-0410-92ff-de0c093fc19c

History

#1 Updated by Mateusz Loskot - over 16 years ago

I've forgot to tell where the buggy usage of stream occurs: [source:trunk/qgis/src/plugins/dxf2shp_converter/builder.cpp@9036#L398 builder.cpp], line 398

#2 Updated by Jürgen Fischer over 16 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

I cleaned up the dxf2shp plugin a bit in 07c905b7 (SVN r9133)

Also available in: Atom PDF