Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
This commit is contained in:
Pierrick Hymbert 2024-03-23 17:51:21 +01:00 committed by GitHub
parent 4da00c1484
commit 34a7665ee7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14839,7 +14839,7 @@ int llama_split_prefix(char * dest, size_t maxlen, const char * split_path, int
std::string str_postfix(postfix); std::string str_postfix(postfix);
// check if dest ends with postfix // check if dest ends with postfix
int size_prefix = str_split_path.size() - str_postfix.size() ; int size_prefix = str_split_path.size() - str_postfix.size();
if (size_prefix > 0 && str_split_path.find(str_postfix, size_prefix) != std::string::npos) { if (size_prefix > 0 && str_split_path.find(str_postfix, size_prefix) != std::string::npos) {
snprintf(dest, std::min((size_t) size_prefix + 1, maxlen), "%s", split_path); snprintf(dest, std::min((size_t) size_prefix + 1, maxlen), "%s", split_path);
return size_prefix; return size_prefix;