diff options
| author | Rich Felker <dalias@aerifal.cx> | 2011-06-13 20:52:01 -0400 | 
|---|---|---|
| committer | Rich Felker <dalias@aerifal.cx> | 2011-06-13 20:52:01 -0400 | 
| commit | 0e1762539c2ad359ba10502cdfb750b5afd2329e (patch) | |
| tree | 09fb60c4a8bd35f5ba16b828b79bc71759dd55f0 /src/stdio/tempnam.c | |
| parent | f09e78de983a8d1daf2f6e071a998eb615f1ce67 (diff) | |
| download | musl-0e1762539c2ad359ba10502cdfb750b5afd2329e.tar.gz | |
avoid 64bit warnings when using pointers as entropy for temp names
Diffstat (limited to 'src/stdio/tempnam.c')
| -rw-r--r-- | src/stdio/tempnam.c | 3 | 
1 files changed, 2 insertions, 1 deletions
diff --git a/src/stdio/tempnam.c b/src/stdio/tempnam.c index dc4f2bad..f73ca9f9 100644 --- a/src/stdio/tempnam.c +++ b/src/stdio/tempnam.c @@ -1,6 +1,7 @@  #include <stdio.h>  #include <string.h>  #include <stdlib.h> +#include <stdint.h>  #include <unistd.h>  #include <time.h>  #include "libc.h" @@ -30,7 +31,7 @@ char *tempnam(const char *dir, const char *pfx)  	do {  		clock_gettime(CLOCK_REALTIME, &ts); -		n = ts.tv_nsec ^ (unsigned)&s ^ (unsigned)s; +		n = ts.tv_nsec ^ (uintptr_t)&s ^ (uintptr_t)s;  		snprintf(s, l, "%s/%s-%d-%d-%x", dir, pfx, pid, a_fetch_add(&index, 1), n);  	} while (!access(s, F_OK) && try++<MAXTRIES);  	if (try>=MAXTRIES) {  | 
