about summary refs log tree commit diff
path: root/src/stdio/tmpnam.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/stdio/tmpnam.c')
-rw-r--r--src/stdio/tmpnam.c2
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;
 }