=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-add.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -r1.43 -r1.44 --- src/usr.bin/ssh/ssh-add.c 2001/06/27 06:26:36 1.43 +++ src/usr.bin/ssh/ssh-add.c 2001/08/01 22:03:33 1.44 @@ -35,7 +35,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-add.c,v 1.43 2001/06/27 06:26:36 markus Exp $"); +RCSID("$OpenBSD: ssh-add.c,v 1.44 2001/08/01 22:03:33 markus Exp $"); #include @@ -144,13 +144,13 @@ } static void -update_card(AuthenticationConnection *ac, int add, int id) +update_card(AuthenticationConnection *ac, int add, const char *id) { if (ssh_update_card(ac, add, id)) - fprintf(stderr, "Card %s: %d\n", + fprintf(stderr, "Card %s: %s\n", add ? "added" : "removed", id); else - fprintf(stderr, "Could not %s card: %d\n", + fprintf(stderr, "Could not %s card: %s\n", add ? "add" : "remove", id); } @@ -205,7 +205,8 @@ AuthenticationConnection *ac = NULL; struct passwd *pw; char buf[1024]; - int i, ch, deleting = 0, sc_reader_num = -1; + char *sc_reader_id = NULL; + int i, ch, deleting = 0; SSLeay_add_all_algorithms(); @@ -230,11 +231,11 @@ goto done; break; case 's': - sc_reader_num = atoi(optarg); + sc_reader_id = optarg; break; case 'e': deleting = 1; - sc_reader_num = atoi(optarg); + sc_reader_id = optarg; break; default: usage(); @@ -244,8 +245,8 @@ } argc -= optind; argv += optind; - if (sc_reader_num != -1) { - update_card(ac, !deleting, sc_reader_num); + if (sc_reader_id != NULL) { + update_card(ac, !deleting, sc_reader_id); goto done; } if (argc == 0) {