summaryrefslogtreecommitdiff
path: root/render/form.c
diff options
context:
space:
mode:
Diffstat (limited to 'render/form.c')
-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;