mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-31 18:05:14 +02:00
Do not report an error when correctly indexing a length-1 vector.
This commit is contained in:
committed by
Holger Vogt
parent
07ca1354eb
commit
93567da529
@@ -720,15 +720,15 @@ op_ind(struct pnode *arg1, struct pnode *arg2)
|
||||
/* Just in case we were sloppy */
|
||||
v->v_numdims = 1;
|
||||
v->v_dims[0] = v->v_length;
|
||||
if (v->v_length <= 1) {
|
||||
fprintf(cp_err, "Error: indexing a scalar (%s)\n",
|
||||
if (v->v_length < 1) {
|
||||
fprintf(cp_err, "Error: indexing empty vector (%s)\n",
|
||||
v->v_name);
|
||||
return (NULL);
|
||||
}
|
||||
}
|
||||
|
||||
if (ind->v_length != 1) {
|
||||
fprintf(cp_err, "Error:strchr %s is not of length 1\n",
|
||||
fprintf(cp_err, "Error: index vector %s is not of length 1\n",
|
||||
ind->v_name);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user