mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-23 04:33:24 +00:00
Used std::string to fix crash on grabbing mouse with Ctrl+F5
This commit is contained in:
parent
481b675e1a
commit
ed86a18497
@ -49,6 +49,7 @@
|
||||
#include <SDL_thread.h>
|
||||
#include <errno.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#ifdef WIN32
|
||||
#include <malloc.h> /* alloca() */
|
||||
@ -537,11 +538,11 @@ static void set_window_name(bool mouse_grabbed)
|
||||
if (vi && vi->wm_available)
|
||||
{
|
||||
const char *title = PrefsFindString("title");
|
||||
char *str = (char *)(title ? title : GetString(STR_WINDOW_TITLE));
|
||||
std::string s = title ? title : GetString(STR_WINDOW_TITLE);
|
||||
if(grabbed)
|
||||
strcat(str, GetString(grabbed));
|
||||
s += GetString(grabbed);
|
||||
//The icon name should stay the same
|
||||
SDL_WM_SetCaption(str, GetString(STR_WINDOW_TITLE));
|
||||
SDL_WM_SetCaption(s.c_str(), GetString(STR_WINDOW_TITLE));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user