Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
unix, windows: don't include null byte in uv_cwd size
Browse files Browse the repository at this point in the history
Make it consistent with uv_exepath
  • Loading branch information
saghul committed Oct 16, 2014
1 parent 68ac0a6 commit 8a8cff4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/unix/core.c
Expand Up @@ -637,7 +637,7 @@ int uv_cwd(char* buffer, size_t* size) {
if (getcwd(buffer, *size) == NULL)
return -errno;

*size = strlen(buffer) + 1;
*size = strlen(buffer);
return 0;
}

Expand Down
4 changes: 2 additions & 2 deletions src/win/util.c
Expand Up @@ -206,7 +206,7 @@ int uv_cwd(char* buffer, size_t* size) {
if (r == 0) {
return uv_translate_sys_error(GetLastError());
} else if (r > (int) *size) {
*size = r;
*size = r -1;
return UV_ENOBUFS;
}

Expand All @@ -223,7 +223,7 @@ int uv_cwd(char* buffer, size_t* size) {
return uv_translate_sys_error(GetLastError());
}

*size = r;
*size = r - 1;
return 0;
}

Expand Down

0 comments on commit 8a8cff4

Please sign in to comment.