diff options
author | Tor Lillqvist <tml@iki.fi> | 2013-02-18 11:57:02 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@iki.fi> | 2013-02-18 11:59:41 +0200 |
commit | 730cff74c04dc6ec2cfc9cf9dcec172392f50616 (patch) | |
tree | df1554a9f66bf22b6a2e67df2cc4d1c19c333e65 /sd | |
parent | d27589108bbdc5d6362d458fb0eb1f53f7091806 (diff) |
std::vector::data() is C++11
Change-Id: I729606a879cfd6330ce9cf3ad7723d2558c07c4a
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/remotecontrol/BluetoothServer.cxx | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sd/source/ui/remotecontrol/BluetoothServer.cxx b/sd/source/ui/remotecontrol/BluetoothServer.cxx index b538d6ddecdf..8366c49bb9a1 100644 --- a/sd/source/ui/remotecontrol/BluetoothServer.cxx +++ b/sd/source/ui/remotecontrol/BluetoothServer.cxx @@ -140,14 +140,17 @@ sal_Int32 OSXBluetoothWrapper::readLine( rtl::OString& aLine ) // We should have in the sal logging some standard way to // output char buffers with non-printables escaped. std::ostringstream s; - for (unsigned char *p = (unsigned char *) mBuffer.data(); p != (unsigned char *) mBuffer.data() + mBuffer.size(); p++) + if (mBuffer.size() > 0) { - if (*p == '\n') - s << "\\n"; - else if (*p < ' ' || (*p >= 0x7F && *p <= 0xFF)) - s << "\\0x" << std::hex << std::setw(2) << std::setfill('0') << (int) *p << std::setfill(' ') << std::setw(1) << std::dec; - else - s << *p; + for (unsigned char *p = (unsigned char *) &mBuffer.front(); p != (unsigned char *) &mBuffer.front() + mBuffer.size(); p++) + { + if (*p == '\n') + s << "\\n"; + else if (*p < ' ' || (*p >= 0x7F && *p <= 0xFF)) + s << "\\0x" << std::hex << std::setw(2) << std::setfill('0') << (int) *p << std::setfill(' ') << std::setw(1) << std::dec; + else + s << *p; + } } SAL_INFO( "sdremote.bluetooth", " mBuffer: \"" << s.str() << "\"" ); #endif |