mirror of
https://github.com/bblanchon/ArduinoJson.git
synced 2025-07-18 04:52:22 +02:00
Changed JsonSink to match Arduino's Print class
This commit is contained in:
@ -5,23 +5,11 @@
|
||||
|
||||
#include "StringBuilder.h"
|
||||
|
||||
void StringBuilder::append(const char* s)
|
||||
size_t StringBuilder::append(char c)
|
||||
{
|
||||
char* tail = buffer + length;
|
||||
|
||||
while (*s && length<capacity)
|
||||
{
|
||||
buffer[length++] = *s++;
|
||||
}
|
||||
|
||||
buffer[length] = 0;
|
||||
}
|
||||
|
||||
|
||||
void StringBuilder::append(char c)
|
||||
{
|
||||
if (length >= capacity) return;
|
||||
if (length >= capacity) return 0;
|
||||
|
||||
buffer[length++] = c;
|
||||
buffer[length] = 0;
|
||||
return 1;
|
||||
}
|
Reference in New Issue
Block a user