From a771cbacc014dc79fb3905efcd2ac78d38f5144e Mon Sep 17 00:00:00 2001 From: "james.goppert" Date: Tue, 9 Nov 2010 11:41:08 +0000 Subject: [PATCH] Added buffer overflow warning. git-svn-id: https://arducopter.googlecode.com/svn/trunk@810 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/APM_BinComm/APM_BinComm.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libraries/APM_BinComm/APM_BinComm.cpp b/libraries/APM_BinComm/APM_BinComm.cpp index 109271a605..088bc9a672 100644 --- a/libraries/APM_BinComm/APM_BinComm.cpp +++ b/libraries/APM_BinComm/APM_BinComm.cpp @@ -98,6 +98,13 @@ BinComm::update(void) // XXX we might want to further constrain this count count = _interface->available(); + if (count >= 128) + { + char text[50]; + strncpy(text,"buffer overflow",50); + send_msg_status_text(1,text); + } + while (count--) _decode(_interface->read()); }