summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 95b0ac850..2b2399c50 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.161 2007/09/09 11:38:01 sobrado Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.162 2007/09/11 15:47:17 gilles Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1994 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -141,8 +141,7 @@ ask_filename(struct passwd *pw, const char *prompt)
141 fprintf(stderr, "%s (%s): ", prompt, identity_file); 141 fprintf(stderr, "%s (%s): ", prompt, identity_file);
142 if (fgets(buf, sizeof(buf), stdin) == NULL) 142 if (fgets(buf, sizeof(buf), stdin) == NULL)
143 exit(1); 143 exit(1);
144 if (strchr(buf, '\n')) 144 buf[strcspn(buf, "\n")] = '\0';
145 *strchr(buf, '\n') = 0;
146 if (strcmp(buf, "") != 0) 145 if (strcmp(buf, "") != 0)
147 strlcpy(identity_file, buf, sizeof(identity_file)); 146 strlcpy(identity_file, buf, sizeof(identity_file));
148 have_identity = 1; 147 have_identity = 1;
@@ -962,8 +961,7 @@ do_change_comment(struct passwd *pw)
962 key_free(private); 961 key_free(private);
963 exit(1); 962 exit(1);
964 } 963 }
965 if (strchr(new_comment, '\n')) 964 new_comment[strcspn(new_comment, "\n")] = '\0';
966 *strchr(new_comment, '\n') = 0;
967 } 965 }
968 966
969 /* Save the file using the new passphrase. */ 967 /* Save the file using the new passphrase. */