Author: sginsberg
Date: Fri Aug 21 17:57:26 2009
New Revision: 42829
URL:
http://svn.reactos.org/svn/reactos?rev=42829&view=rev
Log:
[...]
- NDIS: Don't use floating point arithmetics in kernel mode -- spotted by MSVC trying
to link to ftol (gcc inlined the operation).
[...]
Modified: trunk/reactos/drivers/network/ndis/ndis/config.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] Fri Aug 21 17:57:26
2009
@@ -705,7 +705,14 @@
while (j < str.Length && str.Buffer[j] != '\0') j++;
- *NetworkAddressLength = (UINT)((j/2)+0.5);
+ if ((j % 2) == 0)
+ {
+ *NetworkAddressLength = (UINT)(j/2);
+ }
+ else
+ {
+ *NetworkAddressLength = (UINT)((j/2)+1);
+ }
if ((*NetworkAddressLength) == 0)
{