Matthew Martin <[email protected]> writes: > zsh printf's a time_t as a long. The cast is so that I can send the > same patch upstream (assuming that casting to long long is the correct > fix). Bug found with clang.
It looks like zsh does not assume long long and %lld support, so more work might be needed for an upstream patch. However, ok jca@ to commit the patch below in the ports tree. > - Matthew Martin > > > Index: patches/patch-Src_Builtins_sched_c > =================================================================== > RCS file: patches/patch-Src_Builtins_sched_c > diff -N patches/patch-Src_Builtins_sched_c > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-Src_Builtins_sched_c 21 Feb 2016 01:23:00 -0000 > @@ -0,0 +1,12 @@ > +$OpenBSD$ > +--- Src/Builtins/sched.c.orig Fri Feb 19 19:38:11 2016 > ++++ Src/Builtins/sched.c Sat Feb 20 11:06:55 2016 > +@@ -353,7 +353,7 @@ schedgetfn(UNUSED(Param pm)) > + time_t t; > + > + t = sch->time; > +- sprintf(tbuf, "%ld", t); > ++ sprintf(tbuf, "%lld", (long long) t); > + if (sch->flags & SCHEDFLAG_TRASH_ZLE) > + flagstr = "-o"; > + else > -- jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
