Skip to content

Commit

Permalink
Better Coverity hint (CID #1619299)
Browse files Browse the repository at this point in the history
In normal use, fr_nbo_from_uint64v will return 1 to 8 - telling Coverity
it can return 0 then leads to another false positive.
  • Loading branch information
ndptech committed Dec 23, 2024
1 parent 947aa30 commit cc77a47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/util/nbo.h
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static inline size_t fr_nbo_from_uint64v(uint8_t out[static sizeof(uint64_t)], u
* Coverity doesn't realize that ret is necessarily <= 8,
* so we give it a hint.
*/
if (ret > 8) return 0;
if (ret > 8) return 1;
#endif

fr_nbo_from_uint64(swapped, num);
Expand Down

0 comments on commit cc77a47

Please sign in to comment.