diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-12-05 16:42:17 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-12-05 16:42:17 +0100 |
commit | e5c01e102c790a918ecfda66cfce7cb5e5f8af0a (patch) | |
tree | d2ab239d8a3d664c793b3d35fd34e9f0030cede2 /src/passphrase.c | |
parent | add description of strength value (diff) | |
download | libpassphrase-e5c01e102c790a918ecfda66cfce7cb5e5f8af0a.tar.gz libpassphrase-e5c01e102c790a918ecfda66cfce7cb5e5f8af0a.tar.bz2 libpassphrase-e5c01e102c790a918ecfda66cfce7cb5e5f8af0a.tar.xz |
customisable meter
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r-- | src/passphrase.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/passphrase.c b/src/passphrase.c index 33c7276..01e96cb 100644 --- a/src/passphrase.c +++ b/src/passphrase.c @@ -307,13 +307,10 @@ static void passcheck_update(struct passcheck_state* state, const char* passphra } strength_ptr = 0; - /* TODO locale */ - if (value == 0) desc = "1;31m" "Well-known common password"; - else if (value <= 150) desc = "31m" "Extremely week"; - else if (value <= 200) desc = "33m" "Week"; - else if (value <= 250) desc = "32m" "Good"; - else if (value <= 350) desc = "1;32m" "Strong"; - else desc = "1;7;32m" "Perfect"; + if (0); +#define X(COND, COLOUR, DESC) else if (COND) desc = COLOUR"m"DESC; + LIST_PASSPHRASE_STRENGTH_LIMITS(value) +#undef X if (state->flags & PASSPHRASE_READ_SCREEN_FREE) fprintf(stderr, "\033[s\033[E\033[0K%s \033[%s\033[m (%lli)\033[u", state->label, desc, value); |