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

comm: fix appending doubles to events #244

Merged
merged 2 commits into from Apr 5, 2016
Merged

Conversation

mathstuf
Copy link
Member

@mathstuf mathstuf commented Apr 1, 2016

Only the length of the added string needs to be added to the length of
the string.

Introduced in 1a99091.


@keis

@keis
Copy link
Member

keis commented Apr 1, 2016

Actually I think it's supposed to be assigning the len and not adding to it. Reading up on the functions again it looks like g_string_set_size modifies len which I think I was trying to adjust for but I clearly messed that up 😓

@mathstuf
Copy link
Member Author

mathstuf commented Apr 1, 2016

The old code (before it became a function) just added the strlen, but either fix should work.

@keis
Copy link
Member

keis commented Apr 1, 2016

I think that was buggy but it would only trigger when resizing the string. heh, really wish I would have put some comment in about that because I really can't remember now.

@mathstuf
Copy link
Member Author

mathstuf commented Apr 1, 2016

Looking at g_string_set_size, it doesn't look to be the function we really want to be using here. Maybe just using g_string_append with a stack array is best here rather than trying to be too clever.

@keis
Copy link
Member

keis commented Apr 1, 2016

agreed. it's a bit of a hack to begin with. +1 on using a buffer on the stack.

Use a static buffer for making the string. g_string_set_size can do
weird things that are best avoided.

Introduced in 1a99091.
@mathstuf
Copy link
Member Author

mathstuf commented Apr 5, 2016

Updated to use the buffer on the stack.

@keis
Copy link
Member

keis commented Apr 5, 2016

LGTM!

@mathstuf mathstuf merged commit af1b49b into uzbl:master Apr 5, 2016
@mathstuf mathstuf deleted the fix-scrollbar branch April 5, 2016 19:48
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

Successfully merging this pull request may close these issues.

None yet

2 participants