summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNathan Angelacos <nangel@alpinelinux.org>2008-03-17 18:28:12 +0000
committerNathan Angelacos <nangel@alpinelinux.org>2008-03-17 18:28:12 +0000
commit8b71b1f62a9e7027d33b2a0987630c274f9c2f19 (patch)
tree7d936178f7bba516f432840940717f5d3d99abd0 /src
parent984ea9219aeffc9bd4147df526c146315ceca0c0 (diff)
downloadhaserl-8b71b1f62a9e7027d33b2a0987630c274f9c2f19.tar.bz2
haserl-8b71b1f62a9e7027d33b2a0987630c274f9c2f19.tar.xz
Care for single character checkboxes
Diffstat (limited to 'src')
-rw-r--r--src/haserl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/haserl.c b/src/haserl.c
index fbdf9e7..9769fda 100644
--- a/src/haserl.c
+++ b/src/haserl.c
@@ -237,7 +237,7 @@ myputenv (list_t * cur, char *str, char *prefix)
}
/* does the value already exist? */
- len = keylen + strlen (prefix) + 2;
+ len = keylen + strlen (prefix) + 1;
while (cur != NULL)
{
if (memcmp (cur->buf, entry, len) == 0)
@@ -247,8 +247,8 @@ myputenv (list_t * cur, char *str, char *prefix)
/* if an array, create a new string with this
* value added to the end of the old value(s)
*/
- temp = xmalloc (strlen (cur->buf) + len);
- memmove (temp, cur->buf, strlen (cur->buf));
+ temp = xmalloc (strlen (cur->buf) + len + 1);
+ memmove (temp, cur->buf, strlen (cur->buf) + 1);
strcat (temp, "\n");
strcat (temp, str + keylen + 3);
free (entry);