mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-10-31 08:51:55 +00:00 
			
		
		
		
	tests : avoid sprintf in test-model-random
This commit is contained in:
		| @@ -342,7 +342,7 @@ struct model_variant { | ||||
|  | ||||
|             char buf[32]; | ||||
|             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_scores[i] = -1000.0f; | ||||
|                 vocab_types[i]  = 4;  // USER_DEFINED type | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Francis Couture-Harpin
					Francis Couture-Harpin