fix regression in getspnam[_r] error code for insufficient buffer size

commit 2d7d05f031 wrongly changed ERANGE
to EINVAL, likely as the result of copy-and-paste error.
This commit is contained in:
Rich Felker 2017-06-21 19:06:45 -04:00
parent 5948bc1a64
commit 91d34c4533

View File

@ -76,7 +76,7 @@ int getspnam_r(const char *name, struct spwd *sp, char *buf, size_t size, struct
/* Buffer size must at least be able to hold name, plus some.. */
if (size < l+100)
return errno = EINVAL;
return errno = ERANGE;
/* Protect against truncation */
if (snprintf(path, sizeof path, "/etc/tcb/%s/shadow", name) >= sizeof path)