summaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2024-12-30 05:50:10 +0000
committermidipix <writeonce@midipix.org>2024-12-30 06:17:43 +0000
commit5f293f0453aa6b03e06cc56b0126024cec847e24 (patch)
tree045fdab3b7b4bdf105ff4175929d091c3d5aba39 /src/internal
parent71d0639e72e21cd7020818891b1b23f01765ef08 (diff)
downloadslibtool-5f293f0453aa6b03e06cc56b0126024cec847e24.tar.bz2
slibtool-5f293f0453aa6b03e06cc56b0126024cec847e24.tar.xz
slbt_ar_merge_archives(), slbt_tmpfile(): guard against 32-bit time_t types.
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/slibtool_tmpfile_impl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/internal/slibtool_tmpfile_impl.c b/src/internal/slibtool_tmpfile_impl.c
index 52c7317..3ed7d3a 100644
--- a/src/internal/slibtool_tmpfile_impl.c
+++ b/src/internal/slibtool_tmpfile_impl.c
@@ -61,6 +61,7 @@ slbt_hidden int slbt_tmpfile(void)
{
int fd;
void * addr;
+ int64_t tint;
char tmplate[128];
/* try with __fs_tmpfile() */
@@ -73,6 +74,7 @@ slbt_hidden int slbt_tmpfile(void)
/* fallback to mk{o}stemp */
addr = tmplate;
+ tint = time(0);
memset(tmplate,0,sizeof(tmplate));
snprintf(tmplate,sizeof(tmplate),
"/tmp/"
@@ -81,8 +83,7 @@ slbt_hidden int slbt_tmpfile(void)
".salt.%p"
".pid.%d"
".XXXXXXXXXXXX",
- time(0),
- addr,
+ tint,addr,
getpid());
return slbt_mkostemp(tmplate);