Don't write NUL bytes in uncompressed_memcopy()

This commit is contained in:
Brandon Mulcahy 2015-07-28 07:21:58 -04:00
parent 14ba83ac84
commit 96e3c9c230

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)