tvote.c: show poll name in heading - vote - simple cgi voting system for web and gopher
(HTM) git clone git://src.adamsgaard.dk/vote
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit f5b5aff4672c9a58d24ef7a2d06629870e411a6e
(DIR) parent 10c2ffb581321cb59e676d3f577ce0946debe5c6
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Sun, 27 Sep 2020 10:08:19 +0200
vote.c: show poll name in heading
Diffstat:
M vote.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/vote.c b/vote.c
t@@ -68,7 +68,7 @@ print_poll_line(char *line)
}
void
-print_poll_file(FILE *fp)
+print_poll_file(FILE *fp, const char *poll_name)
{
char *line = NULL;
size_t linesize = 0;
t@@ -81,9 +81,9 @@ print_poll_file(FILE *fp)
line[--linelen] = '\0';
if (lineno == 1) {
- printf("<h1>");
+ printf("<h1>%s: <i>", poll_name);
fwrite(line, linelen, 1, stdout);
- printf("</h1>");
+ printf("</i></h1>");
printf("<table>\n");
} else {
print_poll_line(line);
t@@ -114,7 +114,7 @@ show_poll(const char *poll_name)
http_status(404);
exit(1);
} else {
- print_poll_file(fd);
+ print_poll_file(fd, poll_name);
fclose(fd);
}
}