From ff46d37cd451fecb45e65fb4ee68c826737efce4 Mon Sep 17 00:00:00 2001 From: Klas Lindfors Date: Wed, 28 Mar 2012 08:10:53 +0200 Subject: [PATCH] update text depending on command to be written to key. --- ykpersonalize.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ykpersonalize.c b/ykpersonalize.c index ef24ebc..de0ff78 100644 --- a/ykpersonalize.c +++ b/ykpersonalize.c @@ -197,8 +197,16 @@ int main(int argc, char **argv) } else { char commitbuf[256]; size_t commitlen; - fprintf(stderr, "Configuration data to be written to key configuration %d:\n\n", ykp_config_num(cfg)); - ykp_write_config(cfg, writer, stderr); + if (ykp_command(cfg) == SLOT_SWAP) { + fprintf(stderr, "Configuration in slot 1 and 2 will be swapped\n"); + } else { + if (ykp_command(cfg) == SLOT_CONFIG || ykp_command(cfg) == SLOT_CONFIG2) { + fprintf(stderr, "Configuration data to be written to key configuration %d:\n\n", ykp_config_num(cfg)); + } else { + fprintf(stderr, "Configuration data to be updated in key configuration %d:\n\n", ykp_command(cfg) == SLOT_UPDATE1 ? 1 : 2); + } + ykp_write_config(cfg, writer, stderr); + } fprintf(stderr, "\nCommit? (y/n) [n]: "); if (autocommit) { strcpy(commitbuf, "yes"); -- 2.39.5