lib/repo-commit: Drop unreachable conditional branch
(remaining > 0) is asserted by the loop condition, and remaining is not modified between that check and the G_UNLIKELY — so the condition in the G_UNLIKELY will always be true. Spotted by Coverity as issue #1452617. Signed-off-by: Philip Withnall <withnall@endlessm.com> Closes: #1059 Approved by: cgwalters
This commit is contained in:
parent
baa9534fda
commit
4f187b576d
|
|
@ -486,12 +486,7 @@ create_regular_tmpfile_linkable_with_content (OstreeRepo *self,
|
||||||
if (bytes_read < 0)
|
if (bytes_read < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
else if (bytes_read == 0)
|
else if (bytes_read == 0)
|
||||||
{
|
return glnx_throw (error, "Unexpected EOF with %" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT " bytes remaining", remaining, length);
|
||||||
if (G_UNLIKELY (remaining > 0))
|
|
||||||
return glnx_throw (error, "Unexpected EOF with %" G_GUINT64_FORMAT "/%" G_GUINT64_FORMAT " bytes remaining", remaining, length);
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (glnx_loop_write (tmpf.fd, buf, bytes_read) < 0)
|
if (glnx_loop_write (tmpf.fd, buf, bytes_read) < 0)
|
||||||
return glnx_throw_errno_prefix (error, "write");
|
return glnx_throw_errno_prefix (error, "write");
|
||||||
remaining -= bytes_read;
|
remaining -= bytes_read;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue