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:
nicm
2014-01-09 14:05:55 +00:00
parent 994cb872cf
commit adc1f21eae
3 changed files with 8 additions and 7 deletions

6
tmux.c
View File

@ -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. */