Merge pull request #104 from jangler/master

Don't write NUL bytes in uncompressed_memcopy()
This commit is contained in:
Jim Teeuwen 2015-07-28 18:58:31 +02:00
commit 19c9a00bca

View File

@ -335,7 +335,7 @@ func uncompressed_memcopy(w io.Writer, asset *Asset, r io.Reader) error {
if err != nil { if err != nil {
return err return err
} }
if utf8.Valid(b) { if utf8.Valid(b) && !bytes.Contains(b, []byte{0}) {
fmt.Fprintf(w, "`%s`", sanitize(b)) fmt.Fprintf(w, "`%s`", sanitize(b))
} else { } else {
fmt.Fprintf(w, "%+q", b) fmt.Fprintf(w, "%+q", b)