Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion calcApp/src/aCalcPerform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1531,7 +1531,7 @@ long aCalcPerform(double *p_dArg, int num_dArgs, double **pp_aArg,
j = (int)ps2->d;
if (j < 0) j += arraySize;
i = myMAX(myMIN(i,arraySize),0);
j = myMIN(j,arraySize);
j = myMIN(j,arraySize-1);
if (aCalcPerformDebug > 20) printf("\tSUBRANGE*: ix1=%d, ix2=%d\n", i, j);
if (op == SUBRANGE) {
ps->firstEl = 0;
Expand Down
1 change: 1 addition & 0 deletions calcApp/src/calcUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ int nderiv(double *x, double *y, int n, double *d, int npts, double *lx)
double c, b, a;

m = 2*npts+1;
if (n < m) return(-1); /* fit window larger than the array: refuse rather than read OOB */
/* first m/2+1 points */
e = fitpoly(x,y,m, &c, &b, &a, NULL);
if (e) {
Expand Down
4 changes: 2 additions & 2 deletions calcApp/src/sCalcPerform.c
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,7 @@ epicsShareFunc long
ps1 = ps;
toDouble(ps1);
j = myNINT(ps1->d);
j = myMIN(j,SCALC_STRING_SIZE);
j = myMAX(myMIN(j,SCALC_STRING_SIZE),0);
DEC(ps);
if (isDouble(ps)) {
/* numeric variable: bit shift by integer amount */
Expand Down Expand Up @@ -1494,7 +1494,7 @@ epicsShareFunc long
INC(ps);
ps->s = &(ps->local_string[0]);
s = ps->s;
for (i=0; (i<SCALC_STRING_SIZE-1) && *post; )
for (i=0; (i<SCALC_STRING_SIZE-1) && *post; i++)
*s++ = (char)*post++;
*s = '\0';
/* skip to end of string, if we haven't already */
Expand Down
Loading