diff --git a/mtreefs.go b/mtreefs.go index ec69a38..4c1c28a 100644 --- a/mtreefs.go +++ b/mtreefs.go @@ -103,7 +103,7 @@ func mtreeFilename(s string) string { for _, c := range []byte(s) { switch { case c == '\\' || c == '#' || c == ' ' || c < 32 || c > 126: - b.WriteString(fmt.Sprintf("\\%03o", c)) + fmt.Fprintf(&b, "\\%03o", c) default: b.WriteByte(c) } diff --git a/tar.go b/tar.go index c91f4fc..9bbdafe 100644 --- a/tar.go +++ b/tar.go @@ -105,7 +105,7 @@ func tar(ctx context.Context, enc FormatEncoder, fs *fsBufReader, f *File) (n in } // End of the current dir? - if !(path.Dir(f.Path) == dir) { + if path.Dir(f.Path) != dir { fs.Buffer(f) break }