Skip to content

Commit 47f5ec7

Browse files
onionhammernayato
authored andcommitted
Fix ParseMachineId (#459)
Fix issue parsing manual machine id; fixes #458 - second parameter of `Substring` is 'length' not 'index'
1 parent d4bb7ae commit 47f5ec7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DotNetty.Transport/Channels/DefaultChannelId.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ static byte[] ParseMachineId(string value)
123123
var machineId = new byte[MachineIdLen];
124124
for (int i = 0; i < value.Length; i += 2)
125125
{
126-
machineId[i] = (byte)int.Parse(value.Substring(i, i + 2), NumberStyles.AllowHexSpecifier);
126+
machineId[i] = (byte)int.Parse(value.Substring(i, 2), NumberStyles.AllowHexSpecifier);
127127
}
128128
return machineId;
129129
}
@@ -251,4 +251,4 @@ public override bool Equals(object obj)
251251

252252
public override string ToString() => this.AsShortText();
253253
}
254-
}
254+
}

0 commit comments

Comments
 (0)