Suppose that ‘slen’ is equal to (size_t)-1. A few lines up, we had:
if (lastp != 0) goto slow_path;
Therefore, ‘lastp’ must evaluate to false.
Now suppose that ‘slen’ is not equal to (size_t)-1. In that case, we
would have executed:
if (slen != 0) goto slow_path;
Therefore, ‘slen’ must evaluate to false.
Consequently, this code can be seen to be unreachable.
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
}
*converted_size = retval;
-
- if (!dlen) {
- /* Even if we fast path we should note if we ran out of room. */
- if (((slen != (size_t)-1) && slen) ||
- ((slen == (size_t)-1) && lastp)) {
- errno = E2BIG;
- return false;
- }
- }
return true;
slow_path: