Skip to content

Commit

Permalink
Fix ParseMachineId (#459)
Browse files Browse the repository at this point in the history
Fix issue parsing manual machine id; fixes #458 - second parameter of `Substring` is 'length' not 'index'
  • Loading branch information
onionhammer authored and nayato committed Oct 22, 2019
1 parent d4bb7ae commit 47f5ec7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DotNetty.Transport/Channels/DefaultChannelId.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ static byte[] ParseMachineId(string value)
var machineId = new byte[MachineIdLen];
for (int i = 0; i < value.Length; i += 2)
{
machineId[i] = (byte)int.Parse(value.Substring(i, i + 2), NumberStyles.AllowHexSpecifier);
machineId[i] = (byte)int.Parse(value.Substring(i, 2), NumberStyles.AllowHexSpecifier);
}
return machineId;
}
Expand Down Expand Up @@ -251,4 +251,4 @@ public override bool Equals(object obj)

public override string ToString() => this.AsShortText();
}
}
}

0 comments on commit 47f5ec7

Please sign in to comment.