diff options
author | 2009-08-08 21:54:26 +0000 | |
---|---|---|
committer | 2009-08-08 21:54:26 +0000 | |
commit | b290d792d2d3718dcd61b711ca1f962a1eb92a3f (patch) | |
tree | 355f3389395cc61a44aeae759ac10a133cd29916 | |
parent | Infrastructure and commands to manage the environment for processes started (diff) | |
download | wireguard-openbsd-b290d792d2d3718dcd61b711ca1f962a1eb92a3f.tar.xz wireguard-openbsd-b290d792d2d3718dcd61b711ca1f962a1eb92a3f.zip |
Use a temporary variable for strdup of const char *.
-rw-r--r-- | usr.bin/tmux/environ.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/environ.c b/usr.bin/tmux/environ.c index b62bf6d1cff..26d8ee538ea 100644 --- a/usr.bin/tmux/environ.c +++ b/usr.bin/tmux/environ.c @@ -1,4 +1,4 @@ -/* $OpenBSD: environ.c,v 1.1 2009/08/08 21:52:43 nicm Exp $ */ +/* $OpenBSD: environ.c,v 1.2 2009/08/08 21:54:26 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -134,14 +134,14 @@ void environ_update(const char *vars, struct environ *srcenv, struct environ *dstenv) { struct environ_entry *envent; - char *var, *next; + char *copyvars, *var, *next; - vars = next = xstrdup(vars); + copyvars = next = xstrdup(vars); while ((var = strsep(&next, " ")) != NULL) { if ((envent = environ_find(srcenv, var)) == NULL) environ_set(dstenv, var, NULL); else environ_set(dstenv, envent->name, envent->value); } - xfree(vars); + xfree(copyvars); } |