Commit 9f3d2fb5 authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(assign_timeval): Skip whitespace between the number and the suffix.

	Round the tv_usec field properly.
parent 81a46511
/*
* $Id: conf-file.c,v 1.28 2003/07/12 22:26:32 ceder Exp $
* $Id: conf-file.c,v 1.29 2003/07/13 09:47:01 ceder Exp $
* Copyright (C) 1994-1995, 1998-1999, 2001-2002 Lysator Academic Computer Association.
*
* This file is part of the LysKOM server.
......@@ -446,6 +446,9 @@ assign_timeval(const char *val,
else
suffix = par->default_suffix;
while (isspace(*suffix))
++suffix;
for (s = suffix_table; s->suffix != NULL; ++s)
if (!strcmp(s->suffix, suffix))
break;
......@@ -456,7 +459,7 @@ assign_timeval(const char *val,
number *= s->factor;
*(struct timeval*)par->value = timeval_ctor(
number, (number - (int)number) * 1000000);
number, ((number - (int)number) * 1000000) + 0.5);
}
return OK;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment