X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2Ftmpnam.c;h=2bd72b3b7a14baaf4e1e9d9db39e4f13105895a8;hb=b5a527f9ff47b0f4b32c606e385a0c27d861a475;hp=010cf039aac07ee84759c5f5b6950821b787fbec;hpb=8250742b90b8b54e642fa9201bf0cf8b7c27bbb8;p=musl diff --git a/src/stdio/tmpnam.c b/src/stdio/tmpnam.c index 010cf039..2bd72b3b 100644 --- a/src/stdio/tmpnam.c +++ b/src/stdio/tmpnam.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include "libc.h" @@ -23,7 +24,7 @@ char *tmpnam(char *s) do { __syscall(SYS_clock_gettime, CLOCK_REALTIME, &ts, 0); - n = ts.tv_nsec ^ (unsigned)&s ^ (unsigned)s; + n = ts.tv_nsec ^ (uintptr_t)&s ^ (uintptr_t)s; snprintf(s, L_tmpnam, "/tmp/t%x-%x", a_fetch_add(&index, 1), n); } while (!__syscall(SYS_access, s, F_OK) && try++=MAXTRIES ? 0 : s;