diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-06-19 22:31:19 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-06-19 22:31:19 -0400 |
commit | ee96c50d4bac709f02f7007ecf669952d56f1b2d (patch) | |
tree | 21f800d9cadc8564c3e68de9d0802075bbbb6385 /src/unistd/getlogin_r.c | |
parent | ee1f69a3606987a973ccd0b378d26d0fb077364a (diff) | |
download | musl-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.c | 2 |
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; } |