A C++, header-only library for constructing JSON and JSON-like data formats, with JSON Pointer, JSON Patch, JSON Schema, JSONPath, JMESPath, CSV, MessagePack, CBOR, BSON, UBJSON
source.hpp, line 172
[CWE-191] V555: The expression '(length - len) > 0' will work as 'length != len'.
The analyzer detected a potential error in an expression of "A - B > 0" type. It is highly probable that the condition is wrong if the "A - B" subexpression has the unsigned type.
The "A - B > 0" condition holds in all the cases when 'A' is not equal to 'B'. It means that we may write the "A != B" expression instead of "A - B > 0". However, the programmer must have intended to implement quite a different thing
Fixed on master. Noting that the original '(length - len) > 0', equivalent to 'length != len', works correctively, even if not what the author (me) intended.
Hi!
PVS-Studio found another CWE in "fixed" code.
source.hpp, line 172 [CWE-191] V555: The expression '(length - len) > 0' will work as 'length != len'.