X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=setup.c;h=a45ea8309a9773160597f142f1208a6129885499;hb=4db0c8dec5c009cbbb61135a321a48278e668a25;hp=dda67d268dcacce2293d245395a38106860fb881;hpb=c4f8f827555dcbbee148fd1daa4821533ead2ea2;p=git.git diff --git a/setup.c b/setup.c index dda67d268..a45ea8309 100644 --- a/setup.c +++ b/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);