Skip to content

Commit 4e833dd

Browse files
committed
fix(itkPipeline): parameters parsing crash when no space in line
Fix a bug where a call to --help and printing of parameters for a cli app would crash if a description or parameter line did not contain any space.
1 parent 83772f2 commit 4e833dd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/itkPipeline.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,9 @@ ::exit(const CLI::Error &e) -> int
207207
#ifndef ITK_WASM_NO_FILESYSTEM_IO
208208
std::cout << rang::fg::reset;
209209
#endif
210-
std::cout << line.substr(loc) << std::endl;
210+
if (loc == std::string::npos) {
211+
std::cout << line.substr(loc) << std::endl;
212+
}
211213
}
212214
} else if(optionGroup) {
213215
if (line == "") {

0 commit comments

Comments
 (0)