From f41204b39ae4de668eae0f4683e6c8590172f7f2 Mon Sep 17 00:00:00 2001 From: mdw Date: Thu, 25 Jan 2001 21:14:26 +0000 Subject: [PATCH] Nowadays, @SYM_LEN@ doesn't include the terminating null, so revise the buffer-usage calculation. --- env.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/env.c b/env.c index 4aff65e..985dc52 100644 --- a/env.c +++ b/env.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: env.c,v 1.3 2001/01/20 11:48:10 mdw Exp $ + * $Id: env.c,v 1.4 2001/01/25 21:14:26 mdw Exp $ * * Fiddling with environment variables * @@ -30,6 +30,10 @@ /*----- Revision history --------------------------------------------------* * * $Log: env.c,v $ + * Revision 1.4 2001/01/25 21:14:26 mdw + * Nowadays, @SYM_LEN@ doesn't include the terminating null, so revise the + * buffer-usage calculation. + * * Revision 1.3 2001/01/20 11:48:10 mdw * Use new @SYM_LEN@ macro for name lengths. * @@ -177,7 +181,7 @@ char **env_export(sym_table *t) for (sym_mkiter(&i, t); (v = sym_next(&i)) != 0; ) { n++; - sz += SYM_LEN(v) + strlen(v->v) + 1; + sz += SYM_LEN(v) + strlen(v->v) + 2; } /* --- Allocate the big chunk of memory --- */ -- 2.11.0