core/unit-serialize: fix serialization of markers

Follow-up for ff68472a20
This commit is contained in:
Mike Yuan
2024-12-26 21:15:44 +01:00
parent 80797bbb91
commit 5ce8d7d839

View File

@@ -21,10 +21,12 @@ static int serialize_markers(FILE *f, unsigned markers) {
if (markers == 0)
return 0;
bool space = false;
fputs("markers=", f);
for (UnitMarker m = 0; m < _UNIT_MARKER_MAX; m++)
if (FLAGS_SET(markers, 1u << m))
fputs(unit_marker_to_string(m), f);
fputs_with_separator(f, unit_marker_to_string(m), /* separator = */ NULL, &space);
fputc('\n', f);
return 0;
}