diff options
author | Matthias Lederhofer <matled@gmx.net> | 2007-03-11 02:35:00 +0100 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2007-03-10 21:47:45 -0800 |
commit | 96a5702409e193616ad7e56700dd6051ad324654 (patch) | |
tree | 1b5f417bd9f12e6b951036469c876cdc535f37c5 | |
parent | 8bb2b516d56722776255faaccc0b1d63e444a93e (diff) | |
download | git-96a5702409e193616ad7e56700dd6051ad324654.tar.gz |
setup_git_directory_gently: fix off-by-one error
don't tell getcwd that the buffer has one spare byte for an extra /
Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
-rw-r--r-- | setup.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -216,7 +216,7 @@ const char *setup_git_directory_gently(int *nongit_ok) die("Not a git repository: '%s'", gitdirenv); } - if (!getcwd(cwd, sizeof(cwd)) || cwd[0] != '/') + if (!getcwd(cwd, sizeof(cwd)-1) || cwd[0] != '/') die("Unable to read current working directory"); offset = len = strlen(cwd); |