Use getcwd in stead of using getwd so that we try harder to avoid overflowing a buffer.
Use getcwd in stead of using getwd so that we try harder to avoid
overflowing a buffer.

Obtained from: Either OpenBSD or a discussion in bugtraq.

jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase,jrobhoward/SCADAbase