diff options
-rw-r--r-- | render/form.c | 21 |
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; |