summaryrefslogtreecommitdiff
path: root/ssh-keygen.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2006-03-26 14:27:57 +1100
committerDamien Miller <djm@mindrot.org>2006-03-26 14:27:57 +1100
commit5f340065fc047741448e814c7c30018e8012293b (patch)
tree617b765cde91204f2b4ba2ba4048520933c61b04 /ssh-keygen.c
parenta1690d08b4ce6a1a40786048a6299c2b2d60507f (diff)
- deraadt@cvs.openbsd.org 2006/03/25 18:40:14
[ssh-keygen.c] cast strtonum() result to right type
Diffstat (limited to 'ssh-keygen.c')
-rw-r--r--ssh-keygen.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/ssh-keygen.c b/ssh-keygen.c
index 84f13c42f..25c2cfd84 100644
--- a/ssh-keygen.c
+++ b/ssh-keygen.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssh-keygen.c,v 1.141 2006/03/25 13:17:02 djm Exp $ */ 1/* $OpenBSD: ssh-keygen.c,v 1.142 2006/03/25 18:40:14 deraadt 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
@@ -1075,7 +1075,7 @@ main(int ac, char **av)
1075 "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) { 1075 "degiqpclBHvxXyF:b:f:t:U:D:P:N:C:r:g:R:T:G:M:S:a:W:")) != -1) {
1076 switch (opt) { 1076 switch (opt) {
1077 case 'b': 1077 case 'b':
1078 bits = strtonum(optarg, 768, 32768, &errstr); 1078 bits = (u_int32_t)strtonum(optarg, 768, 32768, &errstr);
1079 if (errstr) 1079 if (errstr)
1080 fatal("Bits has bad value %s (%s)", 1080 fatal("Bits has bad value %s (%s)",
1081 optarg, errstr); 1081 optarg, errstr);
@@ -1162,19 +1162,20 @@ main(int ac, char **av)
1162 rr_hostname = optarg; 1162 rr_hostname = optarg;
1163 break; 1163 break;
1164 case 'W': 1164 case 'W':
1165 generator_wanted = strtonum(optarg, 1, UINT_MAX, &errstr); 1165 generator_wanted = (u_int32_t)strtonum(optarg, 1,
1166 UINT_MAX, &errstr);
1166 if (errstr) 1167 if (errstr)
1167 fatal("Desired generator has bad value: %s (%s)", 1168 fatal("Desired generator has bad value: %s (%s)",
1168 optarg, errstr); 1169 optarg, errstr);
1169 break; 1170 break;
1170 case 'a': 1171 case 'a':
1171 trials = strtonum(optarg, 1, UINT_MAX, &errstr); 1172 trials = (u_int32_t)strtonum(optarg, 1, UINT_MAX, &errstr);
1172 if (errstr) 1173 if (errstr)
1173 fatal("Invalid number of trials: %s (%s)", 1174 fatal("Invalid number of trials: %s (%s)",
1174 optarg, errstr); 1175 optarg, errstr);
1175 break; 1176 break;
1176 case 'M': 1177 case 'M':
1177 memory = strtonum(optarg, 1, UINT_MAX, &errstr); 1178 memory = (u_int32_t)strtonum(optarg, 1, UINT_MAX, &errstr);
1178 if (errstr) { 1179 if (errstr) {
1179 fatal("Memory limit is %s: %s", errstr, optarg); 1180 fatal("Memory limit is %s: %s", errstr, optarg);
1180 } 1181 }