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.

BUG=chrome-os-partner:31065
BRANCH=wolf
TEST=Build test with ucode 1Ch. cbfstool shouldn't segfault.

Original-Change-Id: I885bb574bb230905bd42ca0fb6d4a6ef9b0cae03
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/186983
(cherry picked from commit 5300f5375526dbca5f3e9eb73be863cd13f7150d)

Change-Id: I785a326c6b74bb2ca2a84765e4f95682bc7943ea
Signed-off-by: Marc Jones <marc.jones@se-eng.com>
Reviewed-on: https://chromium-review.googlesource.com/210484
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
(cherry picked from commit baf3bee2f7d2248e04aea0ca673743f2f46115e0)
Reviewed-on: https://chromium-review.googlesource.com/214119
Reviewed-by: Shawn Nematbakhsh <shawnn@chromium.org>
Commit-Queue: Shawn Nematbakhsh <shawnn@chromium.org>
Tested-by: Shawn Nematbakhsh <shawnn@chromium.org>
1 file changed