Skip to content

llama.cpp: Fix wrong vsnprintf call in MS compiler #2856

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

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

grahameth
Copy link
Contributor

I made a mistake in the logging output implementation. When compiled with Visual Studio, _vsnprintf was used instead of vsnprintf. _vsnprintf returns -1 when the buffer is too small, but the code expects the needed size.
This PR fixed that. I now tested vsnprintf on Windows and it seems to work in all cornercases as expected.

In the original implementation, I copied the define from an older codebase. That codebase needed to support older VS versions, which don't have access to vsnprintf. llama.cpp requires at least VS2019, so that is not an issue here.

@ggerganov ggerganov merged commit be475f6 into ggml-org:master Aug 28, 2023
akawrykow pushed a commit to akawrykow/llama.cpp that referenced this pull request Aug 29, 2023
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