untwister icon indicating copy to clipboard operation
untwister copied to clipboard

Crashes on empty lines

Open FalcoGer opened this issue 1 year ago • 0 comments

When given an input file with an empty line, the application crashes with an uncaught exception.

$ echo "1\n2\n3\n" > crash.txt
$ untwister -i crash.txt
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 0) >= this->size() (which is 0)
[1]    1160017 IOT instruction (core dumped)  untwister -i crash.txt
$ echo "1\n\n2\n3\n4" > crash2.txt
$ untwister -i crash2.txt
terminate called after throwing an instance of 'std::out_of_range'
  what():  basic_string::at: __n (which is 0) >= this->size() (which is 0)
[1]    1160344 IOT instruction (core dumped)  untwister -i crash2.txt

FalcoGer avatar Jul 25 '22 23:07 FalcoGer