Update of /cvsroot/tmux/tmux/compat
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25263/compat

Modified Files:
        setenv.c 
Log Message:
Must allocate for putenv.


Index: setenv.c
===================================================================
RCS file: /cvsroot/tmux/tmux/compat/setenv.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- setenv.c    19 May 2010 21:31:39 -0000      1.1
+++ setenv.c    5 Jun 2010 18:20:48 -0000       1.2
@@ -25,10 +25,10 @@
 int
 setenv(const char *name, const char *value, unused int overwrite)
 {
-       char    buf[1024];
+       char    *newval;
 
-       snprintf(buf, sizeof(buf), "%s=%s", name, value);
-       return (putenv(buf));
+       xasprintf(&newval, "%s=%s", name, value);
+       return (putenv(newval));
 }
 
 int


------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
tmux-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tmux-cvs

Reply via email to