core/sal: pass commandline parameters by reference
This allows the commandline parameter parser to modify argc, as it finds
arguments for the Fail* client. Additionally argv is correctly null
terminated when removing arguments.
This fixes a bug introduced in eb17e9ef82.
Change-Id: Iabe84530790ecb7c587b0af139127015aad868d5
This commit is contained in:
@ -13,7 +13,8 @@ namespace fail {
|
||||
if (strncmp(argv[i], "-Wf,", 4) == 0) {
|
||||
this->argv.push_back(std::string(argv[i] + 4));
|
||||
|
||||
for (int x = i + 1; x < argc; ++x) {
|
||||
// also copy argv[argc], which equals 0
|
||||
for (int x = i + 1; x <= argc; ++x) {
|
||||
argv[x - 1] = argv[x];
|
||||
}
|
||||
i --;
|
||||
|
||||
Reference in New Issue
Block a user