mirror of
https://github.com/yawut/SDL.git
synced 2026-07-15 08:11:17 -05:00
The title is stored internally as NULL if it's empty, and returned as ""
This commit is contained in:
parent
317cd0515f
commit
92a7dec92f
|
|
@ -1098,7 +1098,7 @@ SDL_SetWindowTitle(SDL_Window * window, const char *title)
|
|||
if (window->title) {
|
||||
SDL_free(window->title);
|
||||
}
|
||||
if (title) {
|
||||
if (title && *title) {
|
||||
window->title = SDL_strdup(title);
|
||||
} else {
|
||||
window->title = NULL;
|
||||
|
|
@ -1114,7 +1114,7 @@ SDL_GetWindowTitle(SDL_Window * window)
|
|||
{
|
||||
CHECK_WINDOW_MAGIC(window, NULL);
|
||||
|
||||
return window->title;
|
||||
return window->title ? window->title : "";
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user