When assigning pointers to labelArray, if the file had a final, empty newline, the last element of labelArray would try to be assigned to a pointer to labelsData + labelsFileSize + 1, which can cause a warning that can disrupt inference:
malloc(): invalid size (unsorted)
I also removed the replacement of the final '\n' with '\0' because it is always done in the loop.
Checklist before requesting a review
[X] I have performed a self-review of my own code
[X] I have verified that the code builds perfectly fine on my local system
[ ] I have added tests that prove my fix is effective or that my feature works
[X] I have commented my code, particularly in hard-to-understand areas
[X] I have verified that my code follows the style already available in the repository
[X] I have made corresponding changes to the documentation
Describe your changes
When assigning pointers to
labelArray
, if the file had a final, empty newline, the last element oflabelArray
would try to be assigned to a pointer tolabelsData + labelsFileSize + 1
, which can cause a warning that can disrupt inference:I also removed the replacement of the final
'\n'
with'\0'
because it is always done in the loop.Checklist before requesting a review