diff --git a/internal/cache/file.go b/internal/cache/file.go index 1bfe922d2..8d8bc5e84 100644 --- a/internal/cache/file.go +++ b/internal/cache/file.go @@ -61,7 +61,7 @@ func (c *Cache) load(h backend.Handle, length int, offset int64) (io.ReadCloser, if size < offset+int64(length) { _ = f.Close() _ = c.remove(h) - return nil, errors.Errorf("cached file %v is too small, removing", h) + return nil, errors.Errorf("cached file %v is too short, removing", h) } if offset > 0 { diff --git a/internal/crypto/crypto.go b/internal/crypto/crypto.go index 0f9179207..58c82e78c 100644 --- a/internal/crypto/crypto.go +++ b/internal/crypto/crypto.go @@ -299,7 +299,7 @@ func (k *Key) Open(dst, nonce, ciphertext, _ []byte) ([]byte, error) { // check for plausible length if len(ciphertext) < k.Overhead() { - return nil, errors.Errorf("trying to decrypt invalid data: ciphertext too small") + return nil, errors.Errorf("trying to decrypt invalid data: ciphertext too short") } l := len(ciphertext) - macSize diff --git a/internal/index/indexmap.go b/internal/index/indexmap.go index 2386e01b6..4a78b9f77 100644 --- a/internal/index/indexmap.go +++ b/internal/index/indexmap.go @@ -204,7 +204,7 @@ func (h *hashedArrayTree) Size() uint { func (h *hashedArrayTree) grow() { idx, subIdx := h.index(h.size) if int(idx) == len(h.blockList) { - // blockList is too small -> double list and block size + // blockList is too short -> double list and block size h.blockSize *= 2 h.mask = h.mask*2 + 1 h.maskShift++ diff --git a/internal/pack/pack.go b/internal/pack/pack.go index 53631a6fb..7d8d87e71 100644 --- a/internal/pack/pack.go +++ b/internal/pack/pack.go @@ -239,7 +239,7 @@ func readRecords(rd io.ReaderAt, size int64, bufsize int) ([]byte, int, error) { case hlen == 0: err = InvalidFileError{Message: "header length is zero"} case hlen < crypto.Extension: - err = InvalidFileError{Message: "header length is too small"} + err = InvalidFileError{Message: "header length is too short"} case int64(hlen) > size-int64(headerLengthSize): err = InvalidFileError{Message: "header is larger than file"} case int64(hlen) > MaxHeaderSize-int64(headerLengthSize): @@ -263,7 +263,7 @@ func readRecords(rd io.ReaderAt, size int64, bufsize int) ([]byte, int, error) { func readHeader(rd io.ReaderAt, size int64) ([]byte, error) { debug.Log("size: %v", size) if size < int64(minFileSize) { - err := InvalidFileError{Message: "file is too small"} + err := InvalidFileError{Message: "file is too short"} return nil, errors.Wrap(err, "readHeader") } @@ -305,7 +305,7 @@ func List(k *crypto.Key, rd io.ReaderAt, size int64) (entries []restic.Blob, hdr } if len(buf) < crypto.CiphertextLength(0) { - return nil, 0, errors.New("invalid header, too small") + return nil, 0, errors.New("invalid header, too short") } hdrSize = headerLengthSize + uint32(len(buf)) diff --git a/internal/repository/prune.go b/internal/repository/prune.go index 77811e321..8ab16ab15 100644 --- a/internal/repository/prune.go +++ b/internal/repository/prune.go @@ -444,7 +444,7 @@ func decidePackAction(ctx context.Context, opts PruneOptions, repo restic.Reposi // This is equivalent to sorting by unused / total space. // Instead of unused[i] / used[i] > unused[j] / used[j] we use // unused[i] * used[j] > unused[j] * used[i] as uint32*uint32 < uint64 - // Moreover packs containing trees and too small packs are sorted to the beginning + // Moreover packs containing trees and too short packs are sorted to the beginning sort.Slice(repackCandidates, func(i, j int) bool { pi := repackCandidates[i].packInfo pj := repackCandidates[j].packInfo