Commit b59ef043 authored by Sam Lantinga's avatar Sam Lantinga

The title is stored internally as NULL if it's empty, and returned as ""

parent 21e184b0
...@@ -1098,7 +1098,7 @@ SDL_SetWindowTitle(SDL_Window * window, const char *title) ...@@ -1098,7 +1098,7 @@ SDL_SetWindowTitle(SDL_Window * window, const char *title)
if (window->title) { if (window->title) {
SDL_free(window->title); SDL_free(window->title);
} }
if (title) { if (title && *title) {
window->title = SDL_strdup(title); window->title = SDL_strdup(title);
} else { } else {
window->title = NULL; window->title = NULL;
...@@ -1114,7 +1114,7 @@ SDL_GetWindowTitle(SDL_Window * window) ...@@ -1114,7 +1114,7 @@ SDL_GetWindowTitle(SDL_Window * window)
{ {
CHECK_WINDOW_MAGIC(window, NULL); CHECK_WINDOW_MAGIC(window, NULL);
return window->title; return window->title ? window->title : "";
} }
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment