From fe876a4442b3faf2647c6696731f6c176c211d55 Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Thu, 24 Jun 2004 19:52:09 +0000 Subject: [PATCH] Fixed bug with NULL pointer on non-vxWorks systems --- motorApp/AcsSrc/devMCB4B.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/motorApp/AcsSrc/devMCB4B.cc b/motorApp/AcsSrc/devMCB4B.cc index b699c493..8bf295af 100644 --- a/motorApp/AcsSrc/devMCB4B.cc +++ b/motorApp/AcsSrc/devMCB4B.cc @@ -166,8 +166,9 @@ STATIC RTN_STATUS MCB4B_build_trans(motor_cmnd command, double *parms, struct mo send = true; rtnval = OK; buff[0] = '\0'; - dval = parms[0]; - ival = NINT(parms[0]); + /* Protect against NULL pointer with WRTITE_MSG(GO/STOP_AXIS/GET_INFO, NULL). */ + dval = (parms == NULL) ? 0.0 : *parms; + ival = NINT(dval); rtnval = (RTN_STATUS) motor_start_trans_com(mr, MCB4B_cards); Debug(5, "MCB4B_build_trans: entry, motor_start_trans_com=%d\n", rtnval);