diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2006-12-30 23:28:53 -0500 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-30 22:22:13 -0800 |
commit | ef5ddb2fe0cdb3bd09acb7229512b6ae9193423f (patch) | |
tree | 685bc4bbc2d6e4dcbbaf11a0e081275477f65657 /git.c | |
parent | c869753ebbb00e188da5ab308d42cc738335f0ab (diff) | |
download | git-ef5ddb2fe0cdb3bd09acb7229512b6ae9193423f.tar.gz |
Use PATH_MAX constant for --bare.
For easier portability we prefer PATH_MAX over seemingly random
constants like 1024. Make it so.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git.c')
-rw-r--r-- | git.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -69,8 +69,8 @@ static int handle_options(const char*** argv, int* argc) } else if (!strncmp(cmd, "--git-dir=", 10)) { setenv("GIT_DIR", cmd + 10, 1); } else if (!strcmp(cmd, "--bare")) { - static char git_dir[1024]; - setenv("GIT_DIR", getcwd(git_dir, 1024), 1); + static char git_dir[PATH_MAX+1]; + setenv("GIT_DIR", getcwd(git_dir, sizeof(git_dir)), 1); } else { fprintf(stderr, "Unknown option: %s\n", cmd); usage(git_usage_string); |