mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-03 22:53:58 +08:00
cppcheck divide by zero
This commit is contained in:
parent
8ac8e3d7d0
commit
3936afcca9
1 changed files with 3 additions and 0 deletions
|
@ -165,6 +165,9 @@ void print_cs(const char *text, pcs s) {
|
|||
}
|
||||
|
||||
static inline uint8_t mod(uint8_t a, uint8_t m) {
|
||||
if (m==0) {
|
||||
return 0; // Actually, divide by zero error
|
||||
}
|
||||
// Just return the input when this is less or equal than the modular value
|
||||
if (a < m) return a;
|
||||
|
||||
|
|
Loading…
Reference in a new issue