tvote.c: show poll name in heading - vote - simple cgi voting system for web an… | |
git clone git://src.adamsgaard.dk/vote | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit f5b5aff4672c9a58d24ef7a2d06629870e411a6e | |
parent 10c2ffb581321cb59e676d3f577ce0946debe5c6 | |
Author: Anders Damsgaard <[email protected]> | |
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(-) | |
--- | |
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); | |
} | |
} |