summaryrefslogtreecommitdiff
path: root/src/password-store.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xsrc/password-store.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/password-store.sh b/src/password-store.sh
index e3e5659..eac5404 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -505,7 +505,8 @@ cmd_generate() {
local path="$1"
local length="${2:-$GENERATED_LENGTH}"
check_sneaky_paths "$path"
- [[ ! $length =~ ^[0-9]+$ ]] && die "Error: pass-length \"$length\" must be a number."
+ [[ $length =~ ^[0-9]+$ ]] || die "Error: pass-length \"$length\" must be a number."
+ [[ $length -gt 0 ]] || die "Error: pass-length must be greater than zero."
mkdir -p -v "$PREFIX/$(dirname -- "$path")"
set_gpg_recipients "$(dirname -- "$path")"
local passfile="$PREFIX/$path.gpg"