Hello Konrad, we're a bit oldschool and discuss the code on the linux-can@vger.kernel.org mailinglist. Feel free to subscribe. On 02/07/2013 11:38 AM, Marc Kleine-Budde wrote: > From: Konrad Anton > > The computation of nanosleep times for the "-g" option to cangen.c (delay > between sends) overflows when more than 2100ms are given. > > Signed-off-by: Marc Kleine-Budde > --- > > This is the pull gitorious pull reqeust transformed into a standard git one. :) > > Marc > > cangen.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/cangen.c b/cangen.c > index 7518c12..db4c803 100644 > --- a/cangen.c > +++ b/cangen.c > @@ -269,7 +269,7 @@ int main(int argc, char **argv) > } > > ts.tv_sec = gap / 1000; > - ts.tv_nsec = ((int)(gap * 1000000)) % 1000000000; > + ts.tv_nsec = (long)(((long long)(gap * 1000000)) % 1000000000ll); What's going on here exactly? gap is a double - Will it be converted into an int before multiplication with 1000000? IIRC there is a difference between "gap * 1000000" and "gap * 1000000.0". In the latter the multiplication is done in floating point, because of the ".0". Marc > > /* recognize obviously missing commandline option */ > if (id_mode == MODE_FIX && frame.can_id > 0x7FF && !extended) { > -- Pengutronix e.K. | Marc Kleine-Budde | Industrial Linux Solutions | Phone: +49-231-2826-924 | Vertretung West/Dortmund | Fax: +49-5121-206917-5555 | Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |