From 17693ef549262774561ffe12d732d594625827f3 Mon Sep 17 00:00:00 2001 From: Martijn Otto Date: Fri, 1 Jul 2016 16:00:40 +0200 Subject: [PATCH] Correctly remove the dependency files on clean and fix frame errors on architectures where chars default to unsigned, fixes issue #52 --- src/Makefile | 2 +- src/receivedframe.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Makefile b/src/Makefile index 673b82e..7448733 100644 --- a/src/Makefile +++ b/src/Makefile @@ -46,7 +46,7 @@ ${STATIC_LIB}: ${STATIC_OBJECTS} ar rcs ${STATIC_LIB} ${STATIC_OBJECTS} clean: - ${RM} *.obj *~* ${SHARED_OBJECTS} ${STATIC_OBJECTS} ${SHARED_LIB} ${STATIC_LIB} + ${RM} *.obj *~* ${SHARED_OBJECTS} ${STATIC_OBJECTS} ${SHARED_LIB} ${STATIC_LIB} ${DEPENDENCIES} ${SHARED_OBJECTS}: ${CPP} ${CPPFLAGS} -fpic -o $@ ${@:%.o=%.cpp} diff --git a/src/receivedframe.cpp b/src/receivedframe.cpp index 71b6eab..07f0c95 100644 --- a/src/receivedframe.cpp +++ b/src/receivedframe.cpp @@ -72,7 +72,7 @@ #include "framecheck.h" #define TYPE_INVALID 0 -#define END_OF_FRAME -50 +#define END_OF_FRAME 206 /** * Set up namespace @@ -102,7 +102,7 @@ ReceivedFrame::ReceivedFrame(const Buffer &buffer, uint32_t max) : _buffer(buffe if (!complete()) return; // buffer is big enough, check for a valid end-of-frame marker - if ((int)buffer.byte(_payloadSize+7) == END_OF_FRAME) return; + if ((uint8_t)buffer.byte(_payloadSize+7) == END_OF_FRAME) return; // the frame is invalid because it does not end with the expected char throw ProtocolException("invalid end of frame marker");