Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
The title is stored internally as NULL if it's empty, and returned as ""
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Aug 29, 2010
1 parent 210300e commit ba18891
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/video/SDL_video.c
Expand Up @@ -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;
Expand All @@ -1114,7 +1114,7 @@ SDL_GetWindowTitle(SDL_Window * window)
{
CHECK_WINDOW_MAGIC(window, NULL);

return window->title;
return window->title ? window->title : "";
}

void
Expand Down

0 comments on commit ba18891

Please sign in to comment.