/* Finalize MTO initialized by sclp_initialize_mto(), updating the sizes of MTO, enclosing MDB, event buffer and SCCB.  */
static void sclp_finalize_mto(struct sclp_buffer *buffer)
/* Finalize MTO initialized by sclp_initialize_mto(), updating the sizes of MTO, enclosing MDB, event buffer and SCCB.  */
static void sclp_finalize_mto(struct sclp_buffer *buffer)
{
	struct write_sccb *sccb;
	struct mto *mto;
	int str_len, mto_size;
	str_len = buffer->current_length;
	buffer->current_line = NULL;
	buffer->current_length = 0;
	mto_size = sizeof(struct mto) + str_len;
	sccb = buffer->sccb;
	mto = (struct mto *)(((addr_t) sccb) + sccb->header.length);
	mto->length = mto_size;
	sccb->header.length += mto_size;
	sccb->msg_buf.header.length += mto_size;
	sccb->msg_buf.mdb.header.length += mto_size;
	buffer->mto_number++;
	buffer->mto_char_sum += str_len;
}