new buffer[128]
fgets(handle, buffer, charsmax(buffer));
It's the size of your buffer, the max length in characters you can retrieve at once.
That's not something which will change on each line.
Just use charsmax(), which means sizeof buffer- 1, and that's it.