We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 69c1c33 commit a37072bCopy full SHA for a37072b
deps/uv/src/unix/core.c
@@ -1000,6 +1000,7 @@ int uv_os_homedir(char* buffer, size_t* size) {
1000
uid_t uid;
1001
size_t bufsize;
1002
size_t len;
1003
+ long initsize;
1004
int r;
1005
1006
if (buffer == NULL || size == NULL || *size == 0)
@@ -1023,10 +1024,12 @@ int uv_os_homedir(char* buffer, size_t* size) {
1023
1024
}
1025
1026
/* HOME is not set, so call getpwuid() */
- bufsize = sysconf(_SC_GETPW_R_SIZE_MAX);
1027
+ initsize = sysconf(_SC_GETPW_R_SIZE_MAX);
1028
- if (bufsize <= 0)
1029
- return -EIO;
+ if (initsize <= 0)
1030
+ bufsize = 4096;
1031
+ else
1032
+ bufsize = (unsigned int) initsize;
1033
1034
uid = getuid();
1035
buf = NULL;
0 commit comments