MCPcopy Create free account
hub / github.com/OpenNFS/OpenNFS / CanMultiply

Function CanMultiply

include/bmpread/bmpread.c:75–78  ·  view source on GitHub ↗

Returns nonzero if the two size_ts can be multiplied without wrapping, or 0 * if the result would wrap. b must not be 0 (we don't even check here since * everything we pass in will have been checked before). */

Source from the content-addressed store, hash-verified

73 * everything we pass in will have been checked before).
74 */
75static int CanMultiply(size_t a, size_t b)
76{
77 return a <= SIZE_MAX / b;
78}
79
80/* Returns nonzero if the uint32_t can be converted to a size_t without losing
81 * data, which is always the case on 32-bit systems and higher, or 0 if such a

Callers 2

GetLineLengthFunction · 0.85
ValidateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected