diff options
author | Rich Felker <dalias@aerifal.cx> | 2011-03-29 09:00:22 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2011-03-29 09:00:22 -0400 |
commit | 8250742b90b8b54e642fa9201bf0cf8b7c27bbb8 (patch) | |
tree | a12ed40d599ed320b5a9c669bddafe3905e48edd /src/stdio/tmpnam.c | |
parent | a88edbec15abe3c8e08d5065d8bea399898e757c (diff) | |
download | musl-8250742b90b8b54e642fa9201bf0cf8b7c27bbb8.tar.gz musl-8250742b90b8b54e642fa9201bf0cf8b7c27bbb8.tar.bz2 musl-8250742b90b8b54e642fa9201bf0cf8b7c27bbb8.tar.xz musl-8250742b90b8b54e642fa9201bf0cf8b7c27bbb8.zip |
fix tempnam name generation, and a small bug in tmpnam on retry limit
Diffstat (limited to 'src/stdio/tmpnam.c')
-rw-r--r-- | src/stdio/tmpnam.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/tmpnam.c b/src/stdio/tmpnam.c index 6099b74b..010cf039 100644 --- a/src/stdio/tmpnam.c +++ b/src/stdio/tmpnam.c @@ -26,5 +26,5 @@ char *tmpnam(char *s) n = ts.tv_nsec ^ (unsigned)&s ^ (unsigned)s; snprintf(s, L_tmpnam, "/tmp/t%x-%x", a_fetch_add(&index, 1), n); } while (!__syscall(SYS_access, s, F_OK) && try++<MAXTRIES); - return try==MAXTRIES ? 0 : s; + return try>=MAXTRIES ? 0 : s; } |