mirror of
https://github.com/tmate-io/tmate.git
synced 2025-08-16 00:28:10 +02:00
Three small changes from Tiago Cunha:
- Check for truncation when copying path. - Don't need to use a temporary buffer in screen_set_title. - Include strerror in output when connecting to server fails.
This commit is contained in:
6
tmux.c
6
tmux.c
@ -361,7 +361,11 @@ main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
free(label);
|
||||
strlcpy(socket_path, path, sizeof socket_path);
|
||||
|
||||
if (strlcpy(socket_path, path, sizeof socket_path) >= sizeof socket_path) {
|
||||
fprintf(stderr, "socket path too long: %s\n", path);
|
||||
exit(1);
|
||||
}
|
||||
free(path);
|
||||
|
||||
/* Set process title. */
|
||||
|
Reference in New Issue
Block a user