diff --git a/src/bin/mj2/meta_out.c b/src/bin/mj2/meta_out.c
index 2c0e27377..139b2704d 100644
--- a/src/bin/mj2/meta_out.c
+++ b/src/bin/mj2/meta_out.c
@@ -846,7 +846,7 @@ void xml_write_mdia(FILE* file, FILE* xmlout, mj2_tk_t *track,
}
for (i = 0; i < 4; i++) {
uint_to_chars(track->url[track->num_url].location[i], buf);
- fprintf(xmlout, " %s\n");
+ fprintf(xmlout, " %s\n", buf);
}
fprintf(xmlout,
" \n"); // table w. flags, URLs, URNs
@@ -868,7 +868,7 @@ void xml_write_mdia(FILE* file, FILE* xmlout, mj2_tk_t *track,
fprintf(xmlout, " ");
for (i = 0; i < 4; i++) {
uint_to_chars(track->urn[track->num_urn].location[i], buf);
- fprintf(xmlout, "%s");
+ fprintf(xmlout, "%s", buf);
}
fprintf(xmlout, "\n");
fprintf(xmlout, " \n");