Skip to content

Commit 8fe213a

Browse files
committed
tests : avoid sprintf in test-model-random
1 parent 7657835 commit 8fe213a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/test-model-random.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ struct model_variant {
342342

343343
char buf[32];
344344
for (size_t i = 0; i < n_vocab; ++i) {
345-
sprintf(buf, "<%zu>", i);
345+
snprintf(buf, sizeof(buf), "<%zu>", i);
346346
vocab_tokens[i] = std::string(buf);
347347
vocab_scores[i] = -1000.0f;
348348
vocab_types[i] = 4; // USER_DEFINED type

0 commit comments

Comments
 (0)