1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-06-02 06:11:10 +00:00

Merge pull request #96 from augfab/getcwd

Really check success of getcwd(3)
This commit is contained in:
fosslinux 2021-05-26 19:54:35 +10:00 committed by GitHub
commit bc5feea397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -529,8 +529,8 @@ int main(int argc, char *argv[])
/* Convert relative gopher roots to absolute roots */
if (st.server_root[0] != '/') {
char cwd[512];
getcwd(cwd, sizeof(cwd));
char cwd_buf[512];
const char *cwd = getcwd(cwd_buf, sizeof(cwd_buf));
if (cwd == NULL) {
die(&st, NULL, "unable to get current path");
}