server.c (server_setup): Check return value of getcwd and in case of error set buff[0] to 0.

* server.c (server_setup): Check return value of
	getcwd and in case of error set buff[0] to 0.

From-SVN: r218732
This commit is contained in:
Uros Bizjak 2014-12-15 09:10:41 +01:00 committed by Uros Bizjak
parent dea91a66ff
commit 451f119935
2 changed files with 7 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2014-12-15 Uros Bizjak <ubizjak@gmail.com>
* server.c (server_setup): Check return value of
getcwd and in case of error set buff[0] to 0.
2014-10-21 Uros Bizjak <ubizjak@gmail.com>
* inclhack.def (glibc_c99_inline_4): Add pthread.h to files.

View file

@ -192,7 +192,8 @@ server_setup (void)
fputs ("trap : 1\n", server_pair.pf_write);
fflush (server_pair.pf_write);
getcwd (buff, MAXPATHLEN + 1);
if (getcwd (buff, MAXPATHLEN + 1) == NULL)
buff[0] = 0;
p_cur_dir = xstrdup (buff);
}