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

Fixed a bug when writing the response #81

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lodi-g
Copy link

@lodi-g lodi-g commented Apr 8, 2018

Changed the way to write response

- Writing len - 1, to avoid writing a \0 to stdout
- Using asprintf to build the url instead of a VLA

- Writing len - 1, to avoid writing a \0 to stdout
- Using asprintf to build the url instead of a VLA
@amckinlay
Copy link

Why is the related change reducing the socket timeout to 500ms better? Why switch to asprintf()? It is not SUS.

+1 on this PR. nc termbin.com 9999 terminates with a null character. When the output of nc is piped directly to the clipboard, the termbin URL looks like:

Screen Shot 2020-11-02 at 2 23 54 PM

When termbin is run from Vim it also shows the null character:

  1 hi
~

:w !{nc termbin.com 9999}
https://termbin.com/jtrg
^@
Press ENTER or type command to continue

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.

2 participants