From 47cf24ba8efa663e68c276dbb7155feb93ec7ef4 Mon Sep 17 00:00:00 2001 From: mweisshaupt1988 Date: Tue, 5 Apr 2016 18:39:00 +0200 Subject: [PATCH] Updated Avoiding pitfalls (markdown) --- Avoiding-pitfalls.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Avoiding-pitfalls.md b/Avoiding-pitfalls.md index 0866280..56b300c 100644 --- a/Avoiding-pitfalls.md +++ b/Avoiding-pitfalls.md @@ -105,7 +105,7 @@ The simplest solution is to explicitly duplicate the strings in the `JsonBuffer` for (int i=0; i<3; i++) { char buffer[16]; sprintf(buffer, "iteration %d", 0); - array.add(jsonBuffer.strlen(buffer)); + array.add(jsonBuffer.strdup(buffer)); } array.printTo(Serial);