fix printf eating the last charecter
This commit is contained in:
parent
9d9c2b7bf4
commit
3c3f38e6f6
|
@ -479,7 +479,7 @@ size_t AsyncWebSocketClient::printf(const char *format, ...) {
|
||||||
//ToDo: figure out a way around this
|
//ToDo: figure out a way around this
|
||||||
size_t len = 1440;
|
size_t len = 1440;
|
||||||
#else
|
#else
|
||||||
size_t len = vsnprintf(NULL, 0, format, arg);
|
size_t len = vsnprintf(NULL, 0, format, arg)+1;
|
||||||
#endif
|
#endif
|
||||||
char * msg = (char*)malloc(len+1);
|
char * msg = (char*)malloc(len+1);
|
||||||
if(msg == NULL){
|
if(msg == NULL){
|
||||||
|
@ -695,7 +695,7 @@ size_t AsyncWebSocket::printfAll(const char *format, ...) {
|
||||||
//ToDo: figure out a way around this
|
//ToDo: figure out a way around this
|
||||||
size_t len = 1440;
|
size_t len = 1440;
|
||||||
#else
|
#else
|
||||||
size_t len = vsnprintf(NULL, 0, format, arg);
|
size_t len = vsnprintf(NULL, 0, format, arg)+1;
|
||||||
#endif
|
#endif
|
||||||
char * msg = (char*)malloc(len+1);
|
char * msg = (char*)malloc(len+1);
|
||||||
if(msg == NULL){
|
if(msg == NULL){
|
||||||
|
|
Loading…
Reference in New Issue