Skip to content

Commit a0ec19e

Browse files
author
j.tara
committed
Patch to fix data strings
1 parent 4c2668c commit a0ec19e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

Cbor/CborDecoder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#include "CborDecoder.h"
22
#include "Arduino.h"
3-
#include <stdlib.h>
43

54

65

@@ -343,10 +342,10 @@ void CborReader::Run() {
343342
} else break;
344343
} else if(state == STATE_STRING_DATA) {
345344
if(input->hasBytes(currentLength)) {
346-
unsigned char *data = new unsigned char[currentLength];
345+
unsigned char data[currentLength];
347346
input->getBytes(data, currentLength);
348347
state = STATE_TYPE;
349-
String str(*data);
348+
String str = (const char *) data;
350349
listener->OnString(str);
351350
} else break;
352351
} else if(state == STATE_ARRAY) {

0 commit comments

Comments
 (0)