MCPcopy Create free account
hub / github.com/abbeycode/UnrarKit / AllocCmdParam

Function AllocCmdParam

Libraries/unrar/cmddata.cpp:37–47  ·  view source on GitHub ↗

Return the pointer to next position in the string and store dynamically allocated command line parameter in Par.

Source from the content-addressed store, hash-verified

35// Return the pointer to next position in the string and store dynamically
36// allocated command line parameter in Par.
37static const wchar *AllocCmdParam(const wchar *CmdLine,wchar **Par)
38{
39 const wchar *NextCmd=GetCmdParam(CmdLine,NULL,0);
40 if (NextCmd==NULL)
41 return NULL;
42 size_t ParSize=NextCmd-CmdLine+2; // Parameter size including the trailing zero.
43 *Par=(wchar *)malloc(ParSize*sizeof(wchar));
44 if (*Par==NULL)
45 return NULL;
46 return GetCmdParam(CmdLine,*Par,ParSize);
47}
48
49
50#if !defined(SFX_MODULE)

Callers 2

ParseCommandLineMethod · 0.85
ProcessSwitchesStringMethod · 0.85

Calls 1

GetCmdParamFunction · 0.85

Tested by

no test coverage detected