diff --git a/src/pmacv3Controller.cpp b/src/pmacv3Controller.cpp index d9c2e88..c13648b 100644 --- a/src/pmacv3Controller.cpp +++ b/src/pmacv3Controller.cpp @@ -1,9 +1,10 @@ +// Needed to use strcpy_s from string.h +#define __STDC_WANT_LIB_EXT1__ 1 #include "pmacv3Controller.h" #include "asynMotorController.h" #include "asynOctetSyncIO.h" #include "pmacv3Axis.h" -#include #include #include #include @@ -19,12 +20,15 @@ * @param src Original string */ void adjustResponseForPrint(char *dst, const char *src) { - strcpy(dst, src); + // Needed to use strcpy_s from string.h +#ifdef __STDC_LIB_EXT1__ + strcpy_s(dst, src); for (size_t i = 0; i < strlen(dst); i++) { if (dst[i] == '\r') { dst[i] = '_'; } } +#endif } /** @@ -325,7 +329,6 @@ asynStatus pmacv3Controller::writeRead(int axisNo, const char *command, if (numExpectedResponses != numReceivedResponses) { adjustResponseForPrint(modResponse, response); - asynPrint(this->pasynUserSelf, ASYN_TRACE_ERROR, "%s => line %d:\nUnexpected response %s (_ are " "carriage returns) for command %s\n",