|
-
April 27th, 2013, 08:30 PM
#2
Re: crashes after displaying 100 bars??? help please.
No idea from looking at the code. What does your debugger say?
A couple of things though.
1) please learn to use code tags
2)
Code:
if ((displayPriceRangeLow < 1) || (displayPriceRangeLow == NULL))
{
displayPriceRangeHigh = 1;
displayPriceRangeLow = 1;
}
// get pixels per dollar
pixelsPerDollar = displayChartHeight / (displayPriceRangeHigh - displayPriceRangeLow);
You have potential division by zero there.
Also, typically NULL is used to test pointer values, not POD types. And since your first test is < 1, NULL would also be < 1, so even if testing for NULL was valid, it would be redundant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|