From 55ab0fd3b8095ab33fb8a1fabcb1120e091e5f41 Mon Sep 17 00:00:00 2001 From: Freddie Akeroyd Date: Tue, 17 May 2022 15:35:24 +0100 Subject: [PATCH] Avoid data() as it is c++11 --- src/server/pv/responseHandlers.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/server/pv/responseHandlers.h b/src/server/pv/responseHandlers.h index 2c19d280..fb17a6d0 100644 --- a/src/server/pv/responseHandlers.h +++ b/src/server/pv/responseHandlers.h @@ -96,7 +96,9 @@ class EchoTransportSender : public TransportSender { EchoTransportSender(osiSockAddr* echoFrom, size_t payloadSize, epics::pvData::ByteBuffer& payloadBuffer) { memcpy(&_echoFrom, echoFrom, sizeof(osiSockAddr)); toEcho.resize(payloadSize); - payloadBuffer.getArray(toEcho.data(), payloadSize); + if (payloadSize) { + payloadBuffer.getArray(&toEcho[0], payloadSize); + } } virtual ~EchoTransportSender() {} @@ -104,7 +106,9 @@ class EchoTransportSender : public TransportSender { virtual void send(epics::pvData::ByteBuffer* buffer, TransportSendControl* control) OVERRIDE FINAL { control->startMessage(CMD_ECHO, toEcho.size(), toEcho.size()); control->setRecipient(_echoFrom); - buffer->putArray(toEcho.data(), toEcho.size()); + if (toEcho.size() > 0) { + buffer->putArray(&toEcho[0], toEcho.size()); + } } private: