Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every 17th byte is lost when using 'paste as code' #10

Open
YraFyra opened this issue May 20, 2024 · 3 comments
Open

Every 17th byte is lost when using 'paste as code' #10

YraFyra opened this issue May 20, 2024 · 3 comments

Comments

@YraFyra
Copy link

YraFyra commented May 20, 2024

Try to paste the following data using 'paste as code':
00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F 40
Every 17th byte is lost.
image

@hajdam
Copy link
Member

hajdam commented May 20, 2024

Hi,
thanks for your report. I can confirm this as reproducible. I'll look into it...

@YraFyra YraFyra changed the title Every 16th byte is lost when using 'paste as code' Every 17th byte is lost when using 'paste as code' May 20, 2024
@YraFyra
Copy link
Author

YraFyra commented May 24, 2024

I think a change in CodeAreaUtils.java (at 3 places) will solve the problem:
Remove
if (bufferUsage < CODE_BUFFER_LENGTH) { buffer[bufferUsage] = value; bufferUsage++; } else { data.insert(data.getDataSize(), buffer, 0, bufferUsage); bufferUsage = 0; }
add
if (bufferUsage == CODE_BUFFER_LENGTH) { data.insert(data.getDataSize(), buffer, 0, bufferUsage); bufferUsage = 0; } buffer[bufferUsage] = value; bufferUsage++;

@YraFyra YraFyra closed this as completed May 24, 2024
@YraFyra YraFyra reopened this May 24, 2024
@hajdam
Copy link
Member

hajdam commented May 24, 2024

I included some fix already, but there are currently other unrelated unfinished changes.
exbin/bined-lib-java@3207c03

I'll try to provide development build soon, but next release is months away anyway...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants