diff options
| author | ishaan <contact@ishaan.cc> | 2026-07-12 09:11:02 +0530 |
|---|---|---|
| committer | ishaan <contact@ishaan.cc> | 2026-07-12 09:11:02 +0530 |
| commit | 7b5328536a82755c2724f2075c31035d709588df (patch) | |
| tree | a56537a5b3d19c695d25ff41f42a670011f23a50 /internal/crypt/rawEncrypt.go | |
| parent | d3e8c5d00d71e7d3d5186b4dc653d0c10ee35870 (diff) | |
fix usage prompt in non usage errors
Diffstat (limited to 'internal/crypt/rawEncrypt.go')
| -rw-r--r-- | internal/crypt/rawEncrypt.go | 4 |
1 files changed, 3 insertions, 1 deletions
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...) |