sb_getline() function
Reads a line from the file handle (without the trailing NL or CRNL) and returns it in a stringbuf. Returns NULL if no characters are read before EOF or error. Note that the character count will *not* be correct for lines containing utf8 sequences. Do not rely on the character count.