1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-11-03 04:27:17 -05: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 */ /* Convert relative gopher roots to absolute roots */
if (st.server_root[0] != '/') { if (st.server_root[0] != '/') {
char cwd[512]; char cwd_buf[512];
getcwd(cwd, sizeof(cwd)); const char *cwd = getcwd(cwd_buf, sizeof(cwd_buf));
if (cwd == NULL) { if (cwd == NULL) {
die(&st, NULL, "unable to get current path"); die(&st, NULL, "unable to get current path");
} }