mirror of
https://github.com/tmux/tmux.git
synced 2024-12-24 18:28:56 +00:00
Fix sscanf that was guaranteed to always fail.
This commit is contained in:
parent
c0888f3fd1
commit
4cb976b408
4
tmux.c
4
tmux.c
@ -1,4 +1,4 @@
|
|||||||
/* $Id: tmux.c,v 1.236 2011-02-14 23:11:33 tcunha Exp $ */
|
/* $Id: tmux.c,v 1.237 2011-03-04 23:13:56 micahcowan Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
|
||||||
@ -135,7 +135,7 @@ parseenvironment(void)
|
|||||||
if ((env = getenv("TMUX")) == NULL)
|
if ((env = getenv("TMUX")) == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (sscanf(env, "%255s,%ld,%d", path, &pid, &idx) != 3)
|
if (sscanf(env, "%255[^,],%ld,%d", path, &pid, &idx) != 3)
|
||||||
return;
|
return;
|
||||||
environ_path = xstrdup(path);
|
environ_path = xstrdup(path);
|
||||||
environ_pid = pid;
|
environ_pid = pid;
|
||||||
|
Loading…
Reference in New Issue
Block a user