Skip to content

Commit

Permalink
Minor min() usage
Browse files Browse the repository at this point in the history
  • Loading branch information
jbanaszczyk committed Apr 12, 2018
1 parent 8ac6588 commit 478c745
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ Pms5003::PmsStatus Pms5003::read(pmsData *data, const size_t nData, const uint8_
return frameLenMismatch;
}

size_t toRead{ min(size_t(thisFrameLen - 2), nData * sizeof(pmsData)) };
size_t toRead{ min(thisFrameLen - 2, nData * sizeof(pmsData)) };
if (data == nullptr) {
toRead = 0;
}
Expand Down

0 comments on commit 478c745

Please sign in to comment.