aboutsummaryrefslogtreecommitdiffstats
path: root/src/tipideed/tipideed.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2023-12-20 15:45:36 +0000
committerLaurent Bercot <ska@appnovation.com>2023-12-20 15:45:36 +0000
commit289236dd5a7f05bd5253840fa03d358ca51406b0 (patch)
tree6855910e5b19f44994b3c0ddd44c28b1c0a641a2 /src/tipideed/tipideed.c
parent51d0fdce74aeb23ef28336037b2d35aa4c955cee (diff)
downloadtipidee-289236dd5a7f05bd5253840fa03d358ca51406b0.tar.gz
Fix small modifier string bug.
Build with new skalibs to avoid env_merge() problems. Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/tipideed/tipideed.c')
-rw-r--r--src/tipideed/tipideed.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/tipideed/tipideed.c b/src/tipideed/tipideed.c
index 69280f6..75a8195 100644
--- a/src/tipideed/tipideed.c
+++ b/src/tipideed/tipideed.c
@@ -125,8 +125,8 @@ static inline void prep_env (size_t *remoteip, size_t *remotehost)
memcpy(var + protolen, "REMOTEHOST", 11) ;
x = getenv(var) ;
- if ((x && !stralloc_catb(&g.sa, var, protolen + 11))
- || !stralloc_catb(&g.sa, "REMOTE_HOST=", 12)) dienomem() ;
+ if (x && !stralloc_catb(&g.sa, var, protolen + 11)) dienomem() ;
+ if (!stralloc_catb(&g.sa, "REMOTE_HOST=", 12)) dienomem() ;
*remotehost = g.sa.len ;
if (x)
{
@@ -136,7 +136,7 @@ static inline void prep_env (size_t *remoteip, size_t *remotehost)
{
if (!stralloc_readyplus(&g.sa, m + 2)) dienomem() ;
if (ip46_is6(&ip)) stralloc_catb(&g.sa, "[", 1) ;
- stralloc_catb(&g.sa, g.sa.s + *remoteip, m) ;
+ stralloc_catb(&g.sa, g.sa.s + *remoteip, m-1) ;
if (ip46_is6(&ip)) stralloc_catb(&g.sa, "]", 1) ;
}
if (!stralloc_0(&g.sa)) dienomem() ;