diff --git a/zet.dpi.c b/zet.dpi.c index e5ec5d4..422ac90 100644 --- a/zet.dpi.c +++ b/zet.dpi.c @@ -194,6 +194,10 @@ static char *zet_get_title(const char *id, char *buf, size_t len) { close(fd); while (*buf == '#') buf++; while (*buf == ' ') buf++; + if (!*buf) { + strncpy(buf, "ยง", sigil_size); + strncpy(buf + sigil_size, id, len); + } return buf; } @@ -623,7 +627,7 @@ static int dpi_serve_zet(int fd, char *path) { ""); char buf[128]; char *title = zet_get_title(id, buf, sizeof(buf)); - rc |= write_html(fd, title, strlen(title)); + if (title != NULL) rc |= write_html(fd, title, strlen(title)); rc |= dprintf(fd, "" ""