From d82754ec5161eeb484dd6dbef9e23f3af04f35fe Mon Sep 17 00:00:00 2001 From: Brad Harding Date: Sat, 1 Aug 2015 13:16:34 +1000 Subject: [PATCH] Don't show display name if there is none In Windows 10 display 1 returns a display name of "0". --- src/i_video.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/i_video.c b/src/i_video.c index 5aa418342f..18fa22dda9 100644 --- a/src/i_video.c +++ b/src/i_video.c @@ -886,8 +886,15 @@ static void SetVideoMode(dboolean output) displayindex = vid_display_default - 1; } if (output) - C_Output("Using display %i of %i called \"%s\".", - displayindex + 1, numdisplays, SDL_GetDisplayName(displayindex)); + { + const char *displayname = SDL_GetDisplayName(displayindex); + + if (strlen(displayname) > 1) + C_Output("Using display %i of %i called \"%s\".", displayindex + 1, numdisplays, + displayname); + else + C_Output("Using display %i of %i.", displayindex + 1, numdisplays); + } if (vid_vsync) flags |= SDL_RENDERER_PRESENTVSYNC;