diff --git a/examples/NDEFSendMessage/NDEFSendMessage.ino b/examples/NDEFSendMessage/NDEFSendMessage.ino index 8ab3b9a..91f9466 100644 --- a/examples/NDEFSendMessage/NDEFSendMessage.ino +++ b/examples/NDEFSendMessage/NDEFSendMessage.ino @@ -44,7 +44,7 @@ void setup() { String encryptionType = "AES"; String password = "Password"; message.addWiFiRecord(ssid, authentificationType, encryptionType, password); - // message.addUriRecord("mailto:deimoshallgmail.com"); // TODO: check @ problem + message.addUriRecord("mailto:deimoshall@gmail.com"); nfc.setSendMsgCallback(messageSentCallback); Serial.println("Initializing..."); diff --git a/src/NdefRecord.cpp b/src/NdefRecord.cpp index 59f4f8a..cac3994 100644 --- a/src/NdefRecord.cpp +++ b/src/NdefRecord.cpp @@ -259,10 +259,11 @@ void NdefRecord::setPayload(String payload) { #endif this->payload = new unsigned char[payload.length()]; - strcpy((char *)this->payload, payload.c_str()); + strncpy((char *)this->payload, payload.c_str(), payload.length()); #ifdef DEBUG3 - // Serial.println("Payload: '" + getHexRepresentation(this->payload, length) + "'"); + Serial.println("Payload length: " + String(length)); + Serial.println("Payload: '" + getHexRepresentation(this->payload, length) + "'"); #endif }