diff --git a/src/drivers/win/help.cpp b/src/drivers/win/help.cpp index 3621d16b..3ff79447 100644 --- a/src/drivers/win/help.cpp +++ b/src/drivers/win/help.cpp @@ -2,16 +2,13 @@ #include "help.h" #include -void OpenHelpWindow(const char *subpage) +using std::string; + +void OpenHelpWindow(string subpage) { - char helpFileName[MAX_PATH]; - strcpy(helpFileName, BaseDirectory); - strcat(helpFileName, "\\fceux.chm"); - if (subpage) - { - strcat(helpFileName, "::/"); - strcat(helpFileName, subpage); - strcat(helpFileName, ".htm"); - } - HtmlHelp(GetDesktopWindow(), helpFileName, HH_DISPLAY_TOPIC, (DWORD)NULL); + string helpFileName = BaseDirectory; + helpFileName += "\\fceux.chm"; + if (subpage.length()) + helpFileName = helpFileName + "::/" + subpage + ".htm"; + HtmlHelp(GetDesktopWindow(), helpFileName.c_str(), HH_DISPLAY_TOPIC, (DWORD)NULL); } diff --git a/src/drivers/win/help.h b/src/drivers/win/help.h index 1c6947ef..153c7f9f 100644 --- a/src/drivers/win/help.h +++ b/src/drivers/win/help.h @@ -1,2 +1,3 @@ +#include // Open a help window to the default topic, or to ::/subpage.htm -void OpenHelpWindow(const char *subpage = NULL); +void OpenHelpWindow(std::string subpage = "");