tallow multiple words in options - vote - simple cgi voting system for web and … | |
git clone git://src.adamsgaard.dk/vote | |
Log | |
Files | |
Refs | |
README | |
LICENSE | |
--- | |
commit 1667fba9d224363f85f8cb4c610a6be55d84b66c | |
parent aa9b98e360f92e876192fd8cbe90dcc9f2da448b | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 6 Oct 2020 16:53:18 +0200 | |
allow multiple words in options | |
Diffstat: | |
M vote.c | 4 ++-- | |
1 file changed, 2 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/vote.c b/vote.c | |
t@@ -109,7 +109,7 @@ print_poll_line(char *line, size_t *i, int intable, int vo… | |
{ | |
size_t c; | |
- if (sscanf(line, "%ld\t%4095s", &c, options) == 2) { | |
+ if (sscanf(line, "%ld\t%4095[^\n]", &c, options) == 2) { | |
if (!intable) { | |
puts("</p>"); | |
if (vote) { | |
t@@ -319,7 +319,7 @@ increment_option(char *poll, size_t n) | |
} | |
while ((linelen = getline(&line, &linesize, fp)) != -1) { | |
- if (sscanf(line, "%ld\t%4095s", &v, options) != 2) | |
+ if (sscanf(line, "%ld\t%4095[^\n]", &v, options) != 2) | |
fputs(line, fp_tmp); | |
else { | |
if (++lineno == n) |