fix mistake in length test in getlogin_r

this was actually dangerously wrong, but presumably nobody uses this
broken function anymore anyway..
This commit is contained in:
Rich Felker 2012-06-19 22:31:19 -04:00
commit ee96c50d4b

View file

@ -7,7 +7,7 @@ int getlogin_r(char *name, size_t size)
{
char *logname = getlogin();
if (!logname) return ENXIO; /* or...? */
if (strlen(name) >= size) return ERANGE;
if (strlen(logname) >= size) return ERANGE;
strcpy(name, logname);
return 0;
}