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:
commit
bc5feea397
@ -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");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user