]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
bug-fix: snprintf prints NULL in place of the last character (#10419)
authorkallewoof <redacted>
Wed, 11 Dec 2024 13:48:04 +0000 (22:48 +0900)
committerGitHub <redacted>
Wed, 11 Dec 2024 13:48:04 +0000 (14:48 +0100)
commit484d2f31aed34ff9f096e3961125762e81d9b7d6
treed62ff4c64edb4d9548649c8655b1ae86208b7b03
parent4b4d92b0986e3b627b9a9ef4782973108bf47691
bug-fix: snprintf prints NULL in place of the last character (#10419)

* bug-fix: snprintf prints NULL in place of the last character

We need to give snprintf enough space to print the last character and the null character, thus we allocate one extra byte and then ignore it when converting to std::string.

* add comment about extra null-term byte requirement
examples/server/utils.hpp
include/llama.h