diff --git a/lib/c/labcomm_encoder.c b/lib/c/labcomm_encoder.c index 973ac782ea22e31f6ff970360371aaf970086a26..4085bbd38c30a93af55714f54ead443ebaf563a3 100644 --- a/lib/c/labcomm_encoder.c +++ b/lib/c/labcomm_encoder.c @@ -64,8 +64,12 @@ struct labcomm_encoder *labcomm_encoder_new( result->writer->action_context, LABCOMM_VERSION, NULL, CURRENT_VERSION); labcomm_write_packed32(result->writer, LABCOMM_VERSION); +#ifdef LENGTH_INCL_TAG length = (labcomm_size_packed32(LABCOMM_VERSION) + labcomm_size_string(CURRENT_VERSION)); +#else + length = labcomm_size_string(CURRENT_VERSION); +#endif labcomm_write_packed32(result->writer, length); labcomm_write_string(result->writer, CURRENT_VERSION); labcomm_writer_end(result->writer, result->writer->action_context);