Vadim Zhukov <[email protected]> writes:
>> Vadim Zhukov <[email protected]> writes:
>>
>> > This patch addresses two problems:
>> >
>> > 1) Usage of getdirentries() - seriously.
>> > 2) 64-bit-time_t fix.
>>
>> time_t should be printed with %ll? plus a (long long) cast. Now,
>> I don't see any (long long) cast in the whole OpenCVS code, and GNU
>> cvs uses %08lx and (long) to print the current time...
>>
>> Maybe use %08llx?
Similar diff for GNU cvs. <Insert joke about CVS and 2038 here>
Index: history.c
===================================================================
RCS file: /cvs/src/gnu/usr.bin/cvs/src/history.c,v
retrieving revision 1.3
diff -u -p -r1.3 history.c
--- history.c 3 Dec 2013 01:32:49 -0000 1.3
+++ history.c 13 Dec 2013 15:56:24 -0000
@@ -866,8 +866,8 @@ history_write (type, update_dir, revs, n
revs = "";
line = xmalloc (strlen (username) + strlen (workdir) + strlen (repos)
+ strlen (revs) + strlen (name) + 100);
- sprintf (line, "%c%08lx|%s|%s|%s|%s|%s\n",
- type, (long) time ((time_t *) NULL),
+ sprintf (line, "%c%08llx|%s|%s|%s|%s|%s\n",
+ type, (long long) time ((time_t *) NULL),
username, workdir, repos, revs, name);
/* Lessen some race conditions on non-Posix-compliant hosts. */
[...]
--
jca | PGP: 0x06A11494 / 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494