summaryrefslogtreecommitdiff
path: root/src/unistd/getlogin_r.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-06-19 22:31:19 -0400
committerRich Felker <dalias@aerifal.cx>2012-06-19 22:31:19 -0400
commitee96c50d4bac709f02f7007ecf669952d56f1b2d (patch)
tree21f800d9cadc8564c3e68de9d0802075bbbb6385 /src/unistd/getlogin_r.c
parentee1f69a3606987a973ccd0b378d26d0fb077364a (diff)
downloadmusl-ee96c50d4bac709f02f7007ecf669952d56f1b2d.tar.gz
musl-ee96c50d4bac709f02f7007ecf669952d56f1b2d.tar.bz2
musl-ee96c50d4bac709f02f7007ecf669952d56f1b2d.tar.xz
musl-ee96c50d4bac709f02f7007ecf669952d56f1b2d.zip
fix mistake in length test in getlogin_r
this was actually dangerously wrong, but presumably nobody uses this broken function anymore anyway..
Diffstat (limited to 'src/unistd/getlogin_r.c')
-rw-r--r--src/unistd/getlogin_r.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/unistd/getlogin_r.c b/src/unistd/getlogin_r.c
index f04f71e5..37ce0d43 100644
--- a/src/unistd/getlogin_r.c
+++ b/src/unistd/getlogin_r.c
@@ -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;
}