Write start line when found

This commit is contained in:
Nick Krichevsky 2018-09-01 16:41:28 -04:00
parent 9d5bc143a2
commit 529b86dade

View file

@ -71,6 +71,11 @@ 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';
if (result.line_type == RESULT_START_LINE) {
message->start_line = malloc((line_size + 1) * sizeof(char));
strcpy(message->start_line, result.line);
message->start_line = result.line;
}
return result;
}