fakedate(): implement ourselfs (Joseph Bisch)..
commit068fe5d3f5f77278261bbe9a045185437279f419
authorSteffen Nurpmeso <steffen@sdaoden.eu>
Mon, 12 Feb 2018 15:01:00 +0000 (12 16:01 +0100)
committerSteffen Nurpmeso <steffen@sdaoden.eu>
Mon, 12 Feb 2018 15:06:03 +0000 (12 16:06 +0100)
tree48425ddce05c2b1d7e0c83c3ac3437581bed43e0
parent1e43647bbc7547b91fad7ede1ddb2d3a8a8314b7
fakedate(): implement ourselfs (Joseph Bisch)..

Our fakedate() implementation called ctime(3), but ctime(3) is
implemented by e.g. musl libc via asctime(localtime()) and may
fail, which we did not test.  But it is worse, musl says:

  ISO C requires us to use the above format string,
  even if it will not fit in the buffer. Thus asctime_r
  is _supposed_ to crash if the fields in tm are too large.
  We follow this behavior and crash "gracefully" to warn
  application developers that they may not be so lucky
  on other implementations (e.g. stack smashing..).

so indeed we cannot use ctime() at all, at least for now, since we
get in there for unchecked user dates!  We have to implement that
thing ourselfs for now.
head.c