mirror of
https://github.com/kanjitalk755/macemu.git
synced 2024-11-27 17:49:48 +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 <SDL_thread.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include <malloc.h> /* alloca() */
|
#include <malloc.h> /* alloca() */
|
||||||
@ -537,11 +538,11 @@ static void set_window_name(bool mouse_grabbed)
|
|||||||
if (vi && vi->wm_available)
|
if (vi && vi->wm_available)
|
||||||
{
|
{
|
||||||
const char *title = PrefsFindString("title");
|
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)
|
if(grabbed)
|
||||||
strcat(str, GetString(grabbed));
|
s += GetString(grabbed);
|
||||||
//The icon name should stay the same
|
//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