aboutsummaryrefslogtreecommitdiff
path: root/src/env-update.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-04-06 01:04:07 +0000
committerRoy Marples <roy@marples.name>2007-04-06 01:04:07 +0000
commit657be653400bdb9fc8ab13037e51ecfbc1af9d40 (patch)
tree8e876d2a345eb56dff9b7c732a082bc00720d020 /src/env-update.c
parent308042c87bd920d787265f1854bf1695bdbab8e4 (diff)
Misc fixes, plugged a memory leak in runscript.c and use va_copy to avoid nasty segfaults
Diffstat (limited to 'src/env-update.c')
-rw-r--r--src/env-update.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/env-update.c b/src/env-update.c
index 8be37b8d..e01c8c48 100644
--- a/src/env-update.c
+++ b/src/env-update.c
@@ -134,10 +134,9 @@ int main (int argc, char **argv)
{
if (isspecial)
{
- envs[k - 1] = rc_xrealloc (envs[k - 1],
- strlen (envs[k - 1]) +
- strlen (entry) + 1);
- sprintf (envs[k - 1] + strlen (envs[k - 1]),
+ int len = strlen (envs[k - 1]) + strlen (entry) + 1;
+ envs[k - 1] = rc_xrealloc (envs[k - 1], len);
+ snprintf (envs[k - 1] + strlen (envs[k - 1]), len,
"%s%s", isspecial_spaced ? " " : ":", value);
}
else