Add comment explaining why length as byte is problematic

This commit is contained in:
jvyden 2021-10-18 10:21:34 -04:00
parent a081d9b384
commit 69280c1213
No known key found for this signature in database
GPG key ID: 18BCF2BE0262B278

View file

@ -23,7 +23,8 @@ namespace UnionPatcher {
using MemoryStream ms = new(data);
using BinaryWriter writer = new(ms);
// using writer.Write(string) writes the length as a byte beforehand which is problematic
// using writer.Write(string) writes the length as a byte beforehand which is problematic because
// LBP uses null-terminated strings, not length-defined strings
byte[] serverUrlAsBytes = Encoding.ASCII.GetBytes(serverUrl);
foreach(string url in ToBePatched) {