summaryrefslogtreecommitdiff
path: root/render
diff options
context:
space:
mode:
authorRichard Wilson <rjw@netsurf-browser.org>2005-05-11 01:34:41 +0000
committerRichard Wilson <rjw@netsurf-browser.org>2005-05-11 01:34:41 +0000
commit303f214df70c72f662383a28f43eaf3137934dd3 (patch)
tree5bda304d32f115ccb9aef1cffe049af3c4a61f56 /render
parent04ac7d63f93c9641d77154e0e8f2d7f4aa3808d5 (diff)
downloadnetsurf-303f214df70c72f662383a28f43eaf3137934dd3.tar.gz
netsurf-303f214df70c72f662383a28f43eaf3137934dd3.tar.bz2
[project @ 2005-05-11 01:34:41 by rjw]
Fix for default checkbox submit value. svn path=/import/netsurf/; revision=1718
Diffstat (limited to 'render')
-rw-r--r--render/form.c21
1 files changed, 10 insertions, 11 deletions
diff --git a/render/form.c b/render/form.c
index 49ae269b4..557e485af 100644
--- a/render/form.c
+++ b/render/form.c
@@ -230,18 +230,17 @@ bool form_successful_controls(struct form *form,
* aren't selected */
if (!control->selected)
continue;
- value = strdup(control->value);
+ if (control->value)
+ value = strdup(control->value);
+ else
+ value = strdup("on");
if (!value) {
- /* no current value -> use "" */
- value = strdup("");
- if (!value) {
- LOG(("failed to duplicate"
- "value '%s' for"
- "control %s",
- control->value,
- control->name));
- goto no_memory;
- }
+ LOG(("failed to duplicate"
+ "value '%s' for"
+ "control %s",
+ control->value,
+ control->name));
+ goto no_memory;
}
break;