mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2025-10-29 08:41:22 +00:00
tests : avoid sprintf in test-model-random
This commit is contained in:
@@ -342,7 +342,7 @@ struct model_variant {
|
|||||||
|
|
||||||
char buf[32];
|
char buf[32];
|
||||||
for (size_t i = 0; i < n_vocab; ++i) {
|
for (size_t i = 0; i < n_vocab; ++i) {
|
||||||
sprintf(buf, "<%zu>", i);
|
snprintf(buf, sizeof(buf), "<%zu>", i);
|
||||||
vocab_tokens[i] = std::string(buf);
|
vocab_tokens[i] = std::string(buf);
|
||||||
vocab_scores[i] = -1000.0f;
|
vocab_scores[i] = -1000.0f;
|
||||||
vocab_types[i] = 4; // USER_DEFINED type
|
vocab_types[i] = 4; // USER_DEFINED type
|
||||||
|
|||||||
Reference in New Issue
Block a user