mirror of
https://github.com/ollama/ollama.git
synced 2025-05-11 10:26:53 +02:00
length check for parameters
This commit is contained in:
parent
be889b2f81
commit
40d0c4a1dc
1 changed files with 4 additions and 0 deletions
|
@ -45,6 +45,10 @@ func Parse(reader io.Reader) ([]Command, error) {
|
||||||
command.Args = string(fields[1])
|
command.Args = string(fields[1])
|
||||||
case "PARAMETER":
|
case "PARAMETER":
|
||||||
fields = bytes.SplitN(fields[1], []byte(" "), 2)
|
fields = bytes.SplitN(fields[1], []byte(" "), 2)
|
||||||
|
if len(fields) < 2 {
|
||||||
|
return nil, fmt.Errorf("missing value for %s", fields)
|
||||||
|
}
|
||||||
|
|
||||||
command.Name = string(fields[0])
|
command.Name = string(fields[0])
|
||||||
command.Args = string(fields[1])
|
command.Args = string(fields[1])
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue