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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user