/** @file\r
Network library functions providing net buffer operation support.\r
\r
-Copyright (c) 2005 - 2009, Intel Corporation.<BR>\r
+Copyright (c) 2005 - 2010, Intel Corporation.<BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
}\r
\r
\r
-\r
/**\r
Create a NET_BUF structure which contains Len byte data of Nbuf starting from\r
Offset.\r
FirstSkip = Offset - Cur;\r
FirstLen = BlockOp[Index].Size - FirstSkip;\r
\r
- //\r
- //redundant assignment to make compiler happy.\r
- //\r
Last = 0;\r
LastLen = 0;\r
\r
FirstLen = Len;\r
}\r
\r
+ ASSERT (Last >= First);\r
BlockOpNum = Last - First + 1;\r
CurBlockOp = 0;\r
\r
Child->BlockOp[0].Size = 0;\r
CurBlockOp++;\r
\r
- }else {\r
+ } else {\r
Child = NetbufAllocStruct (0, BlockOpNum);\r
\r
if (Child == NULL) {\r
CurBlockOp++\r
);\r
\r
- for (Index = First + 1; Index <= Last - 1 ; Index++) {\r
+ for (Index = First + 1; Index < Last; Index++) {\r
NetbufSetBlockOp (\r
Child,\r
BlockOp[Index].Head,\r