diff options
author | Joe Onorato <joeo@google.com> | 2016-10-21 14:31:42 -0700 |
---|---|---|
committer | Joe Onorato <joeo@google.com> | 2016-10-21 14:32:01 -0700 |
commit | 8a5bb6370cd01990d2bb9f74dc4c777d68e95adc (patch) | |
tree | 888948f4c1e77df9d17d4cdfb9fc7b5b86b23dfa /tools/bit/main.cpp | |
parent | 909bbd31177ebc131f91453a9aa206baec4afb9a (diff) |
Fix mac build of bit
Test: make bit
Change-Id: I8005e77babfbe2d48806f9315800e699d1917bb4
Diffstat (limited to 'tools/bit/main.cpp')
-rw-r--r-- | tools/bit/main.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/bit/main.cpp b/tools/bit/main.cpp index 04836adf2288..4974a447be91 100644 --- a/tools/bit/main.cpp +++ b/tools/bit/main.cpp @@ -518,14 +518,17 @@ get_out_dir() // makes all the filenames long when being pretty printed. return "out"; } else { - char* pwd = get_current_dir_name(); + char pwd[PATH_MAX]; + if (getcwd(pwd, PATH_MAX) == NULL) { + fprintf(stderr, "Your pwd is too long.\n"); + exit(1); + } const char* slash = strrchr(pwd, '/'); if (slash == NULL) { slash = ""; } string result(common_base); result += slash; - free(pwd); return result; } } |