kbilsted / NotepadPlusPlusPluginPack.Net

.Net package to install into visual studio to make plugins for Notepad++
Apache License 2.0
164 stars 52 forks source link

Use length for buffer size if available #90

Closed Fruchtzwerg94 closed 2 years ago

Fruchtzwerg94 commented 2 years ago

May addresses the issues #28 #38 #42

Previously the length was ignored which could lead to crashes for large documents

public unsafe string GetText(int length)
{
    byte[] textBuffer = new byte[10000];

The fix uses the length parameter for the buffer if available:

public unsafe string GetText(int length)
{
    byte[] textBuffer = new byte[length];