]> git.r.bdr.sh - rbdr/mobius/blobdiff - hotline/flattened_file_object.go
patch: v0.12.1
[rbdr/mobius] / hotline / flattened_file_object.go
index 6ccd9d7071000e456b2078c5d71414206d422906..c57de19fea4063a91e5f5b9a8e1a27cf009550f7 100644 (file)
@@ -69,6 +69,7 @@ func (ffif *FlatFileInformationFork) friendlyCreator() []byte {
 }
 
 func (ffif *FlatFileInformationFork) setComment(comment []byte) error {
+       ffif.CommentSize = make([]byte, 2)
        ffif.Comment = comment
        binary.BigEndian.PutUint16(ffif.CommentSize, uint16(len(comment)))
 
@@ -109,7 +110,7 @@ func (ffo *flattenedFileObject) TransferSize(offset int64) []byte {
        resForkSize := binary.BigEndian.Uint32(ffo.FlatFileResForkHeader.DataSize[:])
 
        size := make([]byte, 4)
-       binary.BigEndian.PutUint32(size[:], dataSize+resForkSize+uint32(payloadSize)-uint32(offset))
+       binary.BigEndian.PutUint32(size, dataSize+resForkSize+uint32(payloadSize)-uint32(offset))
 
        return size
 }