summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:34 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:34 +0200
commit5376127c071806b0b327b5869f583931bd98217c (patch)
tree1d55098bb6bc7f07e6adc3647845d1d201db80e8 /common
parentc8951fd70bf245a7894ddce5fd6f06a7f082432f (diff)
downloadbarebox-5376127c071806b0b327b5869f583931bd98217c.tar.gz
svn_rev_219
fix off-by-one error
Diffstat (limited to 'common')
-rw-r--r--common/env.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/common/env.c b/common/env.c
index 29151d1..d8fb867 100644
--- a/common/env.c
+++ b/common/env.c
@@ -18,7 +18,7 @@ static struct variable_d *env_list;
static char *var_val(struct variable_d *var)
{
- return &var->data[strlen(var->data) + 2];
+ return &var->data[strlen(var->data) + 1];
}
static char *var_name(struct variable_d *var)
@@ -61,9 +61,8 @@ void setenv (const char *name, const char *value)
printf("cannot setenv: out of mem\n");
return;
}
-
strcpy(&newvar->data[0], name);
- strcpy(&newvar->data[strlen(name) + 2], value);
+ strcpy(&newvar->data[strlen(name) + 1], value);
newvar->next = NULL;
}