aboutsummaryrefslogtreecommitdiff
path: root/pass.c
diff options
context:
space:
mode:
authorsinanmohd <sinan@sinanmohd.com>2023-12-30 19:00:32 +0530
committersinanmohd <sinan@sinanmohd.com>2023-12-30 19:00:46 +0530
commit7960f6b6d80d64001282b7b0b43c0195645cc35c (patch)
tree99db4218323383fbea99faccfed2b67fcd9735f3 /pass.c
parent1a56879bb29e307bd6b00e250e67597235fa0adf (diff)
pass: support unlimited password length
Diffstat (limited to 'pass.c')
-rw-r--r--pass.c18
1 files changed, 5 insertions, 13 deletions
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);