aboutsummaryrefslogtreecommitdiff
path: root/src/env-update.c
diff options
context:
space:
mode:
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