aboutsummaryrefslogtreecommitdiff
path: root/tmux.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicholas.marriott@gmail.com>2007-10-23 10:48:23 +0000
committerNicholas Marriott <nicholas.marriott@gmail.com>2007-10-23 10:48:23 +0000
commit688a487570e39312c39d7a46e0a7ed6e61392ee8 (patch)
treeed01d3073c1decf05b67adc25a19b0901d16d1e9 /tmux.c
parent21c17da7e6f4631dc418a7b1768d217ce1ccae2f (diff)
downloadrtmux-688a487570e39312c39d7a46e0a7ed6e61392ee8.tar.gz
rtmux-688a487570e39312c39d7a46e0a7ed6e61392ee8.tar.bz2
rtmux-688a487570e39312c39d7a46e0a7ed6e61392ee8.zip
Lift last MAXNAMELEN limit on -s argument.
Diffstat (limited to 'tmux.c')
-rw-r--r--tmux.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/tmux.c b/tmux.c
index b89538e2..1aa21711 100644
--- a/tmux.c
+++ b/tmux.c
@@ -1,4 +1,4 @@
-/* $Id: tmux.c,v 1.35 2007-10-20 09:57:08 nicm Exp $ */
+/* $Id: tmux.c,v 1.36 2007-10-23 10:48:23 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -170,19 +170,17 @@ main(int argc, char **argv)
struct hdr hdr;
const char *shell;
struct passwd *pw;
- char *path, *cause, name[MAXNAMELEN];
+ char *path, *cause, *name;
int n, opt;
- *name = '\0';
- path = NULL;
+ path = name = NULL;
while ((opt = getopt(argc, argv, "S:s:v")) != EOF) {
switch (opt) {
case 'S':
path = xstrdup(optarg);
break;
case 's':
- if (strlcpy(name, optarg, sizeof name) >= sizeof name)
- errx(1, "session name too long: %s", optarg);
+ name = xstrdup(optarg);
break;
case 'v':
debug_level++;
@@ -225,10 +223,11 @@ main(int argc, char **argv)
memset(&cctx, 0, sizeof cctx);
if (!(cmd->entry->flags & CMD_NOSESSION) ||
(cmd->entry->flags & CMD_CANTNEST))
- client_fill_sessid(&data.sid, name);
+ client_fill_session(&data);
if (client_init(path, &cctx, cmd->entry->flags & CMD_STARTSERVER) != 0)
exit(1);
b = buffer_create(BUFSIZ);
+ cmd_send_string(b, name);
cmd_send(cmd, b);
cmd_free(cmd);