Fix crash on Mac OS X when parsing the command line parameters
This commit is contained in:
parent
53ef40ba46
commit
e532885598
@ -15,7 +15,9 @@ namespace cryfs {
|
|||||||
vector<char*> afterDoubleDash;
|
vector<char*> afterDoubleDash;
|
||||||
afterDoubleDash.reserve(options.size()-beforeDoubleDash.size()+1);
|
afterDoubleDash.reserve(options.size()-beforeDoubleDash.size()+1);
|
||||||
afterDoubleDash.push_back(options[0]);
|
afterDoubleDash.push_back(options[0]);
|
||||||
std::copy(doubleDashIterator+1, options.end(), std::back_inserter(afterDoubleDash));
|
if (options.end() >= doubleDashIterator+1) {
|
||||||
|
std::copy(doubleDashIterator + 1, options.end(), std::back_inserter(afterDoubleDash));
|
||||||
|
}
|
||||||
return make_pair(
|
return make_pair(
|
||||||
beforeDoubleDash,
|
beforeDoubleDash,
|
||||||
afterDoubleDash
|
afterDoubleDash
|
||||||
|
Loading…
Reference in New Issue
Block a user