From 68460612e31c52d24efc2562d7b741d709613bfb Mon Sep 17 00:00:00 2001 From: Vinyl Darkscratch Date: Tue, 24 Apr 2018 04:40:19 -0700 Subject: [PATCH] Fix #34 --- binding-mri/wallpaper-binding.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/binding-mri/wallpaper-binding.cpp b/binding-mri/wallpaper-binding.cpp index 1e170d8..4abc04e 100644 --- a/binding-mri/wallpaper-binding.cpp +++ b/binding-mri/wallpaper-binding.cpp @@ -33,9 +33,10 @@ static bool isCached = false; RB_METHOD(wallpaperSet) { RB_UNUSED_PARAM; - const char *imageName; + const char *iname; int color; - rb_get_args(argc, argv, "zi", &imageName, &color RB_ARG_END); + rb_get_args(argc, argv, "zi", &iname, &color RB_ARG_END); + std::string imageName = iname; std::string imgname = shState->config().gameFolder + "/Wallpaper/" + imageName + ".bmp"; #ifdef _WIN32 // Crapify the slashes @@ -105,8 +106,8 @@ end: if (hKey) RegCloseKey(hKey); #else - std::size_t found = imgname.find("w32"); - if (found != std::string::npos) imgname.replace(imgname.end()-3, imgname.end(), "unix"); + std::size_t found = imageName.find("w32"); + if (found != std::string::npos) imageName.replace(imageName.end()-3, imageName.end(), "unix"); imgname = shState->config().gameFolder + "/Wallpaper/" + imageName + ".png"; #ifdef __APPLE__