update: Fixed compile warning regarding getcwd

* Used MAXPATHLEN to avoid issues with buffer size for current working
  directory
* Handled the return value of `getcwd` which previously caused a
  compile-time warning.

Signed-off-by: mr.Shu <mr@shu.io>
Merge pull request #4 from mrshu/mrshu/fix-getcwd

update: Fixed compile warning regarding getcwd