summaryrefslogtreecommitdiffstats
path: root/lib/parameter.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/parameter.c')
-rw-r--r--lib/parameter.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/parameter.c b/lib/parameter.c
index 00e9a9f..fdbb2e7 100644
--- a/lib/parameter.c
+++ b/lib/parameter.c
@@ -253,11 +253,14 @@ static int param_string_set(struct device_d *dev, struct param_d *p, const char
struct param_string *ps = to_param_string(p);
int ret;
char *value_save = *ps->value;
+ char *value_new;
if (!val)
val = "";
- *ps->value = xstrdup(val);
+ value_new = xstrdup(val);
+ value_new = strim(value_new);
+ *ps->value = value_new;
if (!ps->set)
return 0;