From bc6bf59bda7a16a7b6816db32fdb49e537f64335 Mon Sep 17 00:00:00 2001 From: Marty Kraimer Date: Wed, 9 Apr 1997 18:14:43 +0000 Subject: [PATCH] In devGpibLib_mbboGpibWork make sure val is in range --- src/dev/devCommonGpib.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dev/devCommonGpib.c b/src/dev/devCommonGpib.c index 295b12fa6..c67bc9ea9 100644 --- a/src/dev/devCommonGpib.c +++ b/src/dev/devCommonGpib.c @@ -3,6 +3,9 @@ /* * $Log$ + * Revision 1.29 1996/06/12 20:04:51 winans + * Added better debugging code to the initXX logic. + * * Revision 1.28 1996/06/06 14:35:41 winans * Fixed external reference to GPIB driver's DRVET * @@ -1950,7 +1953,15 @@ struct gpibDpvt *pdpvt; /* go access board with this message, unless convert was unsuccessful */ /* NOTE the use of val instead of rval for the EFASTO operation index! */ - if ((cnvrtStat == ERROR) || (devGpibLib_xxGpibWork(pdpvt, pCmd->type, pmbbo->val) == ERROR)) + /* P1 will be max number of P3 strings*/ + if(pCmd->P3 && (pCmd->P1<=0)) {/*determine max number of P3 strings*/ + int i=0; + while(pCmd->P3[i] !=NULL) i++; + pCmd->P1 = i; + } + if(pmbbo->val >= pCmd->P1) cnvrtStat = ERROR; + if( (cnvrtStat == ERROR) + || (devGpibLib_xxGpibWork(pdpvt, pCmd->type, pmbbo->val) == ERROR)) { devGpibLib_setPvSevr(pmbbo,WRITE_ALARM,VALID_ALARM); }