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 » U++ Core » [BUG] wParam casting in Ctrl::sProcessMSG
[BUG] wParam casting in Ctrl::sProcessMSG [message #41301] Thu, 28 November 2013 08:55 Go to next message
Zbych is currently offline  Zbych
Messages: 325
Registered: July 2009
Senior Member
Hi,

There should be one more (or one less) casting of msg.wParam to int in Ctrl::sProcessMSG.
Right now when msg.wParam is bigger than 0x80000000, upp application crashes.

Version1:
void Ctrl::sProcessMSG(MSG& msg)
{
	if (msg.message == WM_HOTKEY) {
		if((int)msg.wParam >= 0 && (int)msg.wParam < Ctrl::hotkey.GetCount())
                //^^^^^^^^^^
			Ctrl::hotkey[(int)msg.wParam]();
		return;
	}


Version2:
void Ctrl::sProcessMSG(MSG& msg)
{
	if (msg.message == WM_HOTKEY) {
		if(msg.wParam < (unsigned)Ctrl::hotkey.GetCount())
                //^^^^^^^^^^
			Ctrl::hotkey[(int)msg.wParam]();
		return;
	}


Re: [BUG] wParam casting in Ctrl::sProcessMSG [message #41308 is a reply to message #41301] Fri, 29 November 2013 09:05 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Applied, thanks!

Mirek
Previous Topic: File encoding error in last svn version 6569
Next Topic: Using USEMALLOC flag leads to errors on Log.cpp
Goto Forum:
  


Current Time: Thu Apr 18 12:36:01 CEST 2024

Total time taken to generate the page: 0.02083 seconds