Code

More missing static
[git.git] / setup.c
diff --git a/setup.c b/setup.c
index dda67d268dcacce2293d245395a38106860fb881..14f62c42e3ac6ead75d4963ee705b9a110da3de0 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -39,7 +39,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
        if (len) {
                int speclen = strlen(path);
                char *n = xmalloc(speclen + len + 1);
-       
+
                memcpy(n, prefix, len);
                memcpy(n + len, path, speclen+1);
                path = n;
@@ -47,7 +47,7 @@ const char *prefix_path(const char *prefix, int len, const char *path)
        return path;
 }
 
-/* 
+/*
  * Unlike prefix_path, this should be used if the named file does
  * not have to interact with index entry; i.e. name of a random file
  * on the filesystem.
@@ -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);