Skip to content

Commit

Permalink
Fix per #66
Browse files Browse the repository at this point in the history
Use rf24_min vs min/std::min
  • Loading branch information
TMRh20 committed Nov 26, 2015
1 parent 7eba4ad commit 8552324
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions RF24Network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -619,7 +619,7 @@ uint16_t RF24Network::read(RF24NetworkHeader& header,void* message, uint16_t max
RF24NetworkFrame frame = frame_queue.front();

// How much buffer size should we actually copy?
bufsize = std::min(frame.message_size,maxlen);
bufsize = rf24_min(frame.message_size,maxlen);
memcpy(&header,&(frame.header),sizeof(RF24NetworkHeader));
memcpy(message,frame.message_buffer,bufsize);

Expand All @@ -640,7 +640,7 @@ uint16_t RF24Network::read(RF24NetworkHeader& header,void* message, uint16_t max

if (maxlen > 0)
{
maxlen = min(maxlen,bufsize);
maxlen = rf24_min(maxlen,bufsize);
memcpy(message,frame_queue+10,maxlen);
IF_SERIAL_DEBUG(printf("%lu: NET message size %d\n",millis(),bufsize););

Expand Down

0 comments on commit 8552324

Please sign in to comment.