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

Fix off-by-one in c_format for printf() #332

Merged
merged 1 commit into from Apr 15, 2020
Merged

Fix off-by-one in c_format for printf() #332

merged 1 commit into from Apr 15, 2020

Conversation

hahnjo
Copy link
Contributor

@hahnjo hahnjo commented Apr 15, 2020

The return value of vsnprintf is the number of characters excluding
the null byte, while the second parameter is the maximum number of
bytes that vsnprintf will write including the terminating null byte.

The return value of vsnprintf is the number of characters _excluding_
the null byte, while the second parameter is the maximum number of
bytes that vsnprintf will write _including_ the  terminating null byte.
@hahnjo
Copy link
Contributor Author

@hahnjo hahnjo commented Apr 15, 2020

In most cases, the last character is a line break so I didn't notice...

@JohanMabille
Copy link
Member

@JohanMabille JohanMabille commented Apr 15, 2020

Thanks!

@JohanMabille JohanMabille merged commit 231eafd into jupyter-xeus:master Apr 15, 2020
2 checks passed
@hahnjo hahnjo deleted the printf-null-byte branch Apr 15, 2020
fengjixuchui added a commit to fengjixuchui/xeus-cling that referenced this issue Apr 15, 2020
Merge pull request jupyter-xeus#332 from hahnjo/printf-null-byte
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