From 7b5328536a82755c2724f2075c31035d709588df Mon Sep 17 00:00:00 2001 From: ishaan Date: Sun, 12 Jul 2026 09:11:02 +0530 Subject: fix usage prompt in non usage errors --- internal/crypt/rawEncrypt.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'internal/crypt/rawEncrypt.go') diff --git a/internal/crypt/rawEncrypt.go b/internal/crypt/rawEncrypt.go index 79a1a54..77803e0 100644 --- a/internal/crypt/rawEncrypt.go +++ b/internal/crypt/rawEncrypt.go @@ -2,6 +2,7 @@ package crypt import ( "fmt" + "strconv" "gitlab.com/whiteboardguy/eno/internal/utils" "golang.org/x/crypto/argon2" @@ -34,7 +35,8 @@ func EncryptRawBytes(inputBytes []byte, password []byte) ([]byte, error) { return nil, fmt.Errorf("encrypt: %w", err) } - target := make([]byte, 0, len(headerBytes)+len(encrypted)+20) + lenLen := len(strconv.Itoa(len(headerBytes))) + target := make([]byte, 0, lenLen+1+len(headerBytes)+len(encrypted)) target = fmt.Appendf(target, "%d:", len(headerBytes)) target = append(target, headerBytes...) target = append(target, encrypted...) -- cgit v1.3