Return the pointer to next position in the string and store dynamically allocated command line parameter in Par.
| 35 | // Return the pointer to next position in the string and store dynamically |
| 36 | // allocated command line parameter in Par. |
| 37 | static 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) |
no test coverage detected