зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
8bb2b516d5
Коммит
96a5702409
2
setup.c
2
setup.c
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче