timprove HTML output, <form> should be outside table, use <br/> - 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 b1543e65991695c6b455382a9a9b86b1bec42a6c
 (DIR) parent f5592f94b672d1c35cb7e58f1aa1d5104c4331c3
 (HTM) Author: Hiltjo Posthuma <hiltjo@codemadness.org>
       Date:   Sun,  4 Oct 2020 15:49:41 +0200
       
       improve HTML output, <form> should be outside table, use <br/>
       
       Signed-off-by: Anders Damsgaard <anders@adamsgaard.dk>
       
       Diffstat:
         M vote.c                              |       6 +++---
       
       1 file changed, 3 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/vote.c b/vote.c
       t@@ -111,12 +111,13 @@ print_poll_line(char *line, size_t *i, int intable, int vote)
        
                if (sscanf(line, "%ld\t%4095s", &c, options) == 2) {
                        if (!intable) {
       -                        puts("</p>\n<table>");
       +                        puts("</p>");
                                if (vote) {
                                        puts("<form method=\"get\" action=\"\">");
                                        printf("<input type=\"hidden\" name=\"poll\" "
                                                "value=\"%s\" />\n", poll);
                                }
       +                        puts("<table>");
                        }
                        if (vote) {
                                printf("\t<tr><td class=\"choice\">");
       t@@ -129,8 +130,7 @@ print_poll_line(char *line, size_t *i, int intable, int vote)
                                        c, options);
                        return 1;
                } else {
       -
       -                printf("%s<br>\n", line);
       +                printf("%s<br/>\n", line);
                        return 0;
                }
        }