Skip to content

Commit

Permalink
remove never used comment (#540)
Browse files Browse the repository at this point in the history
By fixing errbuf returning something, it was missed on several rewrites that the comment was still inside.
  • Loading branch information
trivalik authored Nov 3, 2024
1 parent d719097 commit 56a18a5
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions SharpPcap/LibPcap/LibPcapSafeNativeMethods.Encoding.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public IntPtr MarshalManagedToNative(object managedObj)
}
var str = (string)managedObj;
var bytes = StringEncoding.GetBytes(str);
// The problem is that we need a reference to the StringBuilder in MarshalNativeToManaged
// So we get a pointer to it with GCHandle, and put it as prefix of the pointer we return
var ptr = Marshal.AllocHGlobal(bytes.Length + 1);
Marshal.Copy(bytes, 0, ptr, bytes.Length);
// Put zero string termination
Expand Down

0 comments on commit 56a18a5

Please sign in to comment.