diff options
author | Sadie Powell <sadie@witchery.services> | 2024-02-29 19:07:18 +0000 |
---|---|---|
committer | Sadie Powell <sadie@witchery.services> | 2024-02-29 19:11:37 +0000 |
commit | 190c37a68b2de16ff173decbfba85bf4f0dd730d (patch) | |
tree | 5b36deb0047cbdebb21dbb5222c1f6b60f3f39a4 /src/main.cpp | |
parent | a67bef2deeeb010d5d7b8f6e898c76c36c33701a (diff) |
Rework some platform compatibility code.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.cpp b/src/main.cpp index 4fd433ce1..97099b234 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -84,13 +84,13 @@ void Anope::SaveDatabases() */ static Anope::string GetFullProgDir(const Anope::string &argv0) { - char buffer[PATH_MAX]; #ifdef _WIN32 /* Windows has specific API calls to get the EXE path that never fail. * For once, Windows has something of use, compared to the POSIX code * for this, this is positively neato. */ - if (GetModuleFileName(NULL, buffer, PATH_MAX)) + char buffer[MAX_PATH]; + if (GetModuleFileName(NULL, buffer, MAX_PATH)) { Anope::string fullpath = buffer; Anope::string::size_type n = fullpath.rfind("\\"); @@ -99,6 +99,7 @@ static Anope::string GetFullProgDir(const Anope::string &argv0) } #else // Get the current working directory + char buffer[PATH_MAX]; if (getcwd(buffer, PATH_MAX)) { Anope::string remainder = argv0; |