Store the number of bytes read for the line

This commit is contained in:
Nick Krichevsky 2018-09-01 16:48:11 -04:00
parent 93ff826f67
commit ec2da2168b

View file

@ -74,6 +74,7 @@ static struct line_read_result read_line(const char *buffer, int buffer_size, st
result.line = malloc((line_size + 1) * sizeof(char));
memcpy(result.line, buffer, line_size);
result.line[line_size] = '\0';
result.bytes_read = line_size;
if (result.line_type == RESULT_START_LINE) {
message->start_line = malloc((line_size + 1) * sizeof(char));
strcpy(message->start_line, result.line);