justinstenning / SharedMemory

C# shared memory classes for sharing data between processes (Array, Buffer and Circular Buffer)
https://www.nuget.org/packages/SharedMemory
Other
566 stars 118 forks source link

Fix my test struct #12

Closed kasajian closed 8 years ago

kasajian commented 8 years ago

The MyTestStruct example in the test code had a minor bug in it in that it didn't handle null-termination. This could possibly cause a crash if string of exactly 100 characters were used, or if you set the Name field to a shorter string after setting to a longer string.

Realizing that this struct only exists for test code, I don't think it's that big of a deal. But I wanted to get this in anyway because that sample code is something other people may use as a basis of their own implementation, so might as well have the bug fixed.