comparison src/video/SDL_video.c @ 4871:81a6a9f396ba

The title is stored internally as NULL if it's empty, and returned as ""
author Sam Lantinga <slouken@libsdl.org>
date Sun, 29 Aug 2010 16:26:35 -0700
parents 7b1d35d98294
children 231f8a1c5edd
comparison
equal deleted inserted replaced
4870:d275c95ddc05 4871:81a6a9f396ba
1096 return; 1096 return;
1097 } 1097 }
1098 if (window->title) { 1098 if (window->title) {
1099 SDL_free(window->title); 1099 SDL_free(window->title);
1100 } 1100 }
1101 if (title) { 1101 if (title && *title) {
1102 window->title = SDL_strdup(title); 1102 window->title = SDL_strdup(title);
1103 } else { 1103 } else {
1104 window->title = NULL; 1104 window->title = NULL;
1105 } 1105 }
1106 1106
1112 const char * 1112 const char *
1113 SDL_GetWindowTitle(SDL_Window * window) 1113 SDL_GetWindowTitle(SDL_Window * window)
1114 { 1114 {
1115 CHECK_WINDOW_MAGIC(window, NULL); 1115 CHECK_WINDOW_MAGIC(window, NULL);
1116 1116
1117 return window->title; 1117 return window->title ? window->title : "";
1118 } 1118 }
1119 1119
1120 void 1120 void
1121 SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon) 1121 SDL_SetWindowIcon(SDL_Window * window, SDL_Surface * icon)
1122 { 1122 {