diff options
author | Nicholas Marriott <nicm@openbsd.org> | 2013-03-21 16:22:48 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@openbsd.org> | 2013-03-21 16:22:48 +0000 |
commit | 51d989f5dfaa63a844ae291772f20c486a5982fb (patch) | |
tree | a98e23c8f0e09ba52a94ddd8926f8a10432facb7 /cmd.c | |
parent | c982279950de9c9ffa797aab48caa1bff89ee8d4 (diff) | |
download | rtmux-51d989f5dfaa63a844ae291772f20c486a5982fb.tar.gz rtmux-51d989f5dfaa63a844ae291772f20c486a5982fb.tar.bz2 rtmux-51d989f5dfaa63a844ae291772f20c486a5982fb.zip |
Do not crash when calling choose-tree with a command that changes the mode.
Diffstat (limited to 'cmd.c')
-rw-r--r-- | cmd.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -1222,14 +1222,14 @@ cmd_find_pane_offset(const char *paneptr, struct winlink *wl) /* Replace the first %% or %idx in template by s. */ char * -cmd_template_replace(char *template, const char *s, int idx) +cmd_template_replace(const char *template, const char *s, int idx) { - char ch; - char *buf, *ptr; - int replaced; - size_t len; + char ch, *buf; + const char *ptr; + int replaced; + size_t len; - if (strstr(template, "%") == NULL) + if (strchr(template, '%') == NULL) return (xstrdup(template)); buf = xmalloc(1); |