tar_loader: fixups

- from_bytes does not need a mutable reference
- add has_magic method to check the magic field
- fix name to return a string w/o  embedded nul's
- rewrite parse_octal to use iterators
- rewrite find_file to use methods, to stop searching at the first
  invalid (according to has_magic) header, and to correctly check
  for end-of-flash
- change copy_file to check the offset instead of the file size
  when deciding if a file was found--zero-length files can and do exist

Bug: 294433731

Change-Id: Ic769517bfbcc51e2e8c4f1cb485d3bb6338179b4
1 file changed