**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License (version 2) as
// If linked to ctsimtext, but executed as another name, eg pjrec, then program will use that
// linked name as name of function.
// If linked to ctsimtext, but executed as another name, eg pjrec, then program will use that
// linked name as name of function.
extern int if1_main (int argc, char* const argv[]);
extern int if2_main (int argc, char* const argv[]);
extern int if1_main (int argc, char* const argv[]);
extern int if2_main (int argc, char* const argv[]);
char* pszInputLine = new char [s_MaxLineLength+1];
std::cout << szPrompt;
std::cin.getline (pszInputLine, s_MaxLineLength);
char* pszInputLine = new char [s_MaxLineLength+1];
std::cout << szPrompt;
std::cin.getline (pszInputLine, s_MaxLineLength);
- *pppArgv = new char* [nTokens];
- for (unsigned int iToken = 0; iToken < vecpszToken.size(); iToken++)
- (*pppArgv)[iToken] = vecpszToken[iToken];
+ if (nTokens > 0) {
+ *pppArgv = new char* [nTokens];
+ for (unsigned int iToken = 0; iToken < vecpszToken.size(); iToken++)
+ (*pppArgv)[iToken] = vecpszToken[iToken];
+ } else
+ *pppArgv = NULL;
const char* const pszFunction = fileBasename (argv[0]);
if (strcasecmp (pszFunction, "if1") == 0)
const char* const pszFunction = fileBasename (argv[0]);
if (strcasecmp (pszFunction, "if1") == 0)