Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'cb/mkstemps-uint-type-fix' into maint
author
Junio C Hamano
<gitster@pobox.com>
Mon, 29 Jul 2019 19:38:14 +0000
(12:38 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 29 Jul 2019 19:38:14 +0000
(12:38 -0700)
Variable type fix.
* cb/mkstemps-uint-type-fix:
wrapper: avoid undefined behaviour in macOS
wrapper.c
patch
|
blob
|
history
raw
(from parent 1:
dc55e3e
)
diff --git
a/wrapper.c
b/wrapper.c
index ea3cf64d4c399ae84c156b850002459a8ffde72c..1e45ab7b92749b653484f522701f5d86521b03c7 100644
(file)
--- a/
wrapper.c
+++ b/
wrapper.c
@@
-502,7
+502,7
@@
int git_mkstemps_mode(char *pattern, int suffix_len, int mode)
* Try TMP_MAX different filenames.
*/
gettimeofday(&tv, NULL);
- value = ((
size_t)(tv.tv_usec << 16)
) ^ tv.tv_sec ^ getpid();
+ value = ((
uint64_t)tv.tv_usec << 16
) ^ tv.tv_sec ^ getpid();
filename_template = &pattern[len - 6 - suffix_len];
for (count = 0; count < TMP_MAX; ++count) {
uint64_t v = value;