Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ScatterDraw & ScatterCtrl » Uninitialized variables in the file ScatterDraw.cpp will cause crash (Using Visual Studio 2013)
Uninitialized variables in the file ScatterDraw.cpp will cause crash (Using Visual Studio 2013) [message #45947] Sat, 30 January 2016 10:53 Go to next message
kasome is currently offline  kasome
Messages: 78
Registered: July 2008
Location: Taiwan
Member
Uninitialized variables in the file ScatterDraw.cpp will cause crash (Using Visual Studio 2013)


In the file ScatterDraw.cpp, the following function

void ScatterDraw::DrawLegend(Draw& w, const Size &size, int scale) const {

.................................................

          int plotLeft, plotTop, rectWidth, rectHeight; // uninitialized variables

.................................................

         int left = plotLeft + legendPos.x*scale;      // will cause crash here

.................................................

}


just make sure the variables has been initialized before using it, that should fix the problem, i.e.

int plotLeft = 0, plotTop = 0, rectWidth = 0, rectHeight = 0;


the patched file and the original file will upload as the attachment file, please update. Very Happy
Re: Uninitialized variables in the file ScatterDraw.cpp will cause crash (Using Visual Studio 2013) [message #45966 is a reply to message #45947] Mon, 01 February 2016 08:11 Go to previous message
koldo is currently offline  koldo
Messages: 3268
Registered: August 2008
Senior Veteran
Thanks. Fixed.

Best regards
IƱaki
Previous Topic: New ZoomToFit() replaces FitToData()
Next Topic: New ShowProcessDlg()
Goto Forum:
  


Current Time: Tue Dec 07 15:16:35 CET 2021

Total time taken to generate the page: 0.01242 seconds