ggml : fix strncpy warning
This commit is contained in:
parent
c506e6a820
commit
ffab4152aa
1 changed files with 1 additions and 1 deletions
2
ggml.c
2
ggml.c
|
@ -3220,7 +3220,7 @@ const char * ggml_get_name(const struct ggml_tensor * tensor) {
|
|||
}
|
||||
|
||||
struct ggml_tensor * ggml_set_name(struct ggml_tensor * tensor, const char * name) {
|
||||
strncpy(tensor->name, name, sizeof(tensor->name));
|
||||
strncpy(tensor->name, name, sizeof(tensor->name) - 1);
|
||||
tensor->name[sizeof(tensor->name) - 1] = '\0';
|
||||
return tensor;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue