Vadim Zhukov <[email protected]> writes: > 2013/12/13 Jérémie Courrèges-Anglas <[email protected]>: >> 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. */ >> >> >> [...] > > Looks fine for me - but I can't say if we care about upstream > compatibility for src/gnu/usr.bin/cvs? If no, we could also zap a > useless cast of NULL to (time_t*) here, saving the line length (well, > I forgot to mention 2038 here. Oops). :)
I'll just commit it as is, I think that style issues in this code are hop^W^Wbelong in another thread. :) -- jca | PGP: 0x06A11494 / 61DB D9A0 00A4 67CF 2A90 8961 6191 8FBF 06A1 1494
