From f3326d34e78bd28fba6d8cfd3bc455a506b429fe Mon Sep 17 00:00:00 2001 From: Michael Lutz Date: Sun, 6 Dec 2020 21:11:44 +0100 Subject: Codechange: Use std::string in FIO search path handling. --- src/video/sdl_v.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/video/sdl_v.cpp') diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index 98777a87d..4f5167335 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -266,10 +266,10 @@ bool VideoDriver_SDL::CreateMainSurface(uint w, uint h) if (bpp == 0) usererror("Can't use a blitter that blits 0 bpp for normal visuals"); - char icon_path[MAX_PATH]; - if (FioFindFullPath(icon_path, lastof(icon_path), BASESET_DIR, "openttd.32.bmp") != nullptr) { + std::string icon_path = FioFindFullPath(BASESET_DIR, "openttd.32.bmp"); + if (!icon_path.empty()) { /* Give the application an icon */ - icon = SDL_LoadBMP(icon_path); + icon = SDL_LoadBMP(icon_path.c_str()); if (icon != nullptr) { /* Get the colourkey, which will be magenta */ uint32 rgbmap = SDL_MapRGB(icon->format, 255, 0, 255); -- cgit v1.2.3-54-g00ecf