ltog/osmi-addresses

abs() of unsigned int has no effect

Closed this issue · 0 comments

ltog commented

clang warns of usage of abs() for unsigned int values, e.g. here:

} else if (abs(first-last) > 1000) {

Taking the difference of first and last might result in an underflow which won't be noticed by abs()...