diff --git a/Source/exehead/Main.c b/Source/exehead/Main.c index 0c89b6cb..f9b0d4d5 100644 --- a/Source/exehead/Main.c +++ b/Source/exehead/Main.c @@ -124,7 +124,7 @@ int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInst,LPSTR lpszCmdParam, } DeleteFile(state_command_line); - lstrcpyn(state_command_line, GetCommandLine(), NSIS_MAX_STRLEN); + mystrcpy(state_command_line, GetCommandLine()); #ifdef NSIS_CONFIG_VISIBLE_SUPPORT g_hInstance = GetModuleHandle(NULL); diff --git a/Source/exehead/util.c b/Source/exehead/util.c index ab7e126c..5e9a6e46 100644 --- a/Source/exehead/util.c +++ b/Source/exehead/util.c @@ -544,7 +544,7 @@ int NSISCALL myatoi(char *s) // of a new function there should be about a couple of dozen or so calls. char * NSISCALL mystrcpy(char *out, const char *in) { - return lstrcpy(out, in); + return lstrcpyn(out, in, NSIS_MAX_STRLEN); } int NSISCALL mystrlen(const char *in) @@ -680,7 +680,7 @@ char * NSISCALL GetNSISString(char *outbuf, int strtab) } // while *out = 0; if (outbuf) - return lstrcpyn(outbuf, ps_tmpbuf, NSIS_MAX_STRLEN); + return mystrcpy(outbuf, ps_tmpbuf); return ps_tmpbuf; }