UPSTREAM: cbfstool: correct size left calculation for "empty" entries

After removing a file sandwiched between two other files, that file
could no longer be re-added at the same location. cbfstool tried to
add the file, and a new "empty" entry, which, together, would no
longer fit, so it continued checking for the next available space.

Change the behavior to add the file if there is enough space for the
file alone, then only add the "empty" entry if there is enough space
for it.

Change-Id: Ia20f690f902aa7ea1a7c5fa62ca33436cf52d2ab
Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/186982
Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
1 file changed