Fix crash in InputBox.cpp by offering an overloaded func which takes a size, and use it in MenuScreens.cpp / PSPOskDialog.cpp.

This commit is contained in:
The Dax 2013-08-05 22:45:51 -04:00
parent d20ac3c4c2
commit 4570d83c05
4 changed files with 28 additions and 6 deletions

View file

@ -49,6 +49,22 @@ bool InputBox_GetString(HINSTANCE hInst, HWND hParent, TCHAR *title, TCHAR *defa
return false;
}
bool InputBox_GetString(HINSTANCE hInst, HWND hParent, TCHAR *title, TCHAR *defaultvalue, TCHAR *outvalue, u32 outlength)
{
if (defaultvalue && strlen(defaultvalue)<255)
strcpy(textBoxContents,defaultvalue);
else
strcpy(textBoxContents,"");
if (IDOK==DialogBox(hInst,(LPCSTR)IDD_INPUTBOX,hParent,InputBoxFunc))
{
strncpy(outvalue, out, outlength);
return true;
}
else
return false;
}
bool InputBox_GetHex(HINSTANCE hInst, HWND hParent, TCHAR *title, u32 defaultvalue, u32 &outvalue)
{
sprintf(textBoxContents,"%08x",defaultvalue);