Fixes segmentation fault when line length in input was not equal