fix printf eating the last charecter

This commit is contained in:
Me No Dev 2016-04-23 16:11:57 +03:00
parent 9d9c2b7bf4
commit 3c3f38e6f6
1 changed files with 2 additions and 2 deletions

View File

@ -479,7 +479,7 @@ size_t AsyncWebSocketClient::printf(const char *format, ...) {
//ToDo: figure out a way around this
size_t len = 1440;
#else
size_t len = vsnprintf(NULL, 0, format, arg);
size_t len = vsnprintf(NULL, 0, format, arg)+1;
#endif
char * msg = (char*)malloc(len+1);
if(msg == NULL){
@ -695,7 +695,7 @@ size_t AsyncWebSocket::printfAll(const char *format, ...) {
//ToDo: figure out a way around this
size_t len = 1440;
#else
size_t len = vsnprintf(NULL, 0, format, arg);
size_t len = vsnprintf(NULL, 0, format, arg)+1;
#endif
char * msg = (char*)malloc(len+1);
if(msg == NULL){