From 7960f6b6d80d64001282b7b0b43c0195645cc35c Mon Sep 17 00:00:00 2001 From: sinanmohd Date: Sat, 30 Dec 2023 19:00:32 +0530 Subject: pass: support unlimited password length --- pass.c | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'pass.c') diff --git a/pass.c b/pass.c index 7c4d864..a58276d 100644 --- a/pass.c +++ b/pass.c @@ -34,18 +34,13 @@ void print_usage(void) int cat(const char *path) { - const char *s = NULL; - - s = pass_cat(path); - if (!s) - return -1; + int r; - if(isatty(STDOUT_FILENO)) - puts(s); - else - fputs(s, stdout); + r = pass_cat(stdout, path); + if (!r && isatty(STDOUT_FILENO)) + putchar('\n'); - return 0; + return r; } int add(const char *path) @@ -81,9 +76,6 @@ int add(const char *path) if (in != stdin) fclose(in); - if (n > PASS_MAX - 1) /* TODO: get rid of the limit */ - err_die(1, "password must not exceed %d characters", PASS_MAX); - if (strcmp(p1, p2)) { free(p1); free(p2); -- cgit v1.2.3