From 59ed1bef61ed2069cfec33a789b9405d43cfa399 Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 17 May 2016 13:35:24 -0500 Subject: [PATCH] removed warning about unsigned to signed cast --- .../ESP8266/ATParser/BufferedSerial/BufferedSerial.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/net/ESP8266Interface/ESP8266/ATParser/BufferedSerial/BufferedSerial.cpp b/net/ESP8266Interface/ESP8266/ATParser/BufferedSerial/BufferedSerial.cpp index 7b6ba56a8f..d13424264d 100644 --- a/net/ESP8266Interface/ESP8266/ATParser/BufferedSerial/BufferedSerial.cpp +++ b/net/ESP8266Interface/ESP8266/ATParser/BufferedSerial/BufferedSerial.cpp @@ -89,13 +89,15 @@ int BufferedSerial::printf(const char* format, ...) va_start(arg, format); r = vsprintf(buffer, format, arg); // this may not hit the heap but should alert the user anyways - if(r > this->_buf_size) { + if(r > (int32_t) this->_buf_size) { error("%s %d buffer overwrite (max_buf_size: %d exceeded: %d)!\r\n", __FILE__, __LINE__,this->_buf_size,r); va_end(arg); return 0; } va_end(arg); - r = BufferedSerial::write(buffer, r); + if ( r > 0 ) { + r = BufferedSerial::write(buffer, r); + } return r; }