From f49ac391b2bda4c9c0d80575e742ef10c93f2b53 Mon Sep 17 00:00:00 2001 From: me-no-dev Date: Mon, 2 Jan 2017 09:46:13 +0200 Subject: [PATCH] replace wrong calls to cbuf->size in UDP --- libraries/WiFi/src/WiFiUdp.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/WiFi/src/WiFiUdp.cpp b/libraries/WiFi/src/WiFiUdp.cpp index 1b53cb32..1afd4914 100644 --- a/libraries/WiFi/src/WiFiUdp.cpp +++ b/libraries/WiFi/src/WiFiUdp.cpp @@ -205,13 +205,13 @@ int WiFiUDP::parsePacket(){ int WiFiUDP::available(){ if(!rx_buffer) return 0; - return rx_buffer->size(); + return rx_buffer->available(); } int WiFiUDP::read(){ if(!rx_buffer) return -1; int out = rx_buffer->read(); - if(!rx_buffer->size()){ + if(!rx_buffer->available()){ cbuf *b = rx_buffer; rx_buffer = 0; delete b; @@ -226,7 +226,7 @@ int WiFiUDP::read(unsigned char* buffer, size_t len){ int WiFiUDP::read(char* buffer, size_t len){ if(!rx_buffer) return 0; int out = rx_buffer->read(buffer, len); - if(!rx_buffer->size()){ + if(!rx_buffer->available()){ cbuf *b = rx_buffer; rx_buffer = 0; delete b;