diff --git a/stagit.c b/stagit.c
@@ -454,8 +454,10 @@ void writeheader(FILE *fp, const char *title)
"<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n"
"<title>", fp);
xmlencode(fp, strippedname, strlen(strippedname));
- fprintf(fp, " — ");
- xmlencode(fp, title, strlen(title));
+ if (title != NULL) {
+ fprintf(fp, " — ");
+ xmlencode(fp, title, strlen(title));
+ }
fprintf(fp,
"</title>\n"
"<link rel=\"icon\" "
@@ -1211,7 +1213,7 @@ void write_markdown_readme(FILE *fp, git_blob *readme)
const char *markdown = git_blob_rawcontent(readme);
char *html = cmark_markdown_to_html(markdown,
strlen(markdown), CMARK_OPT_SAFE);
- writeheader(fp, "README");
+ writeheader(fp, NULL);
fputs("</ul>\n", fp);
fprintf(fp, "<section id=\"readme\">\n");
fprintf(fp, "%s", html);