summaryrefslogtreecommitdiff
path: root/src/lib/libc/crypt
diff options
context:
space:
mode:
authorray <>2007-02-20 01:44:16 +0000
committerray <>2007-02-20 01:44:16 +0000
commit22b5b07292a5ad742550ecedb80014dfc232ccca (patch)
tree6a33bc2e5f85255d7ac5f8ca6c1cf7b309ea8617 /src/lib/libc/crypt
parenta7d89787c37651709879a99ae7952b28afec63b7 (diff)
downloadopenbsd-22b5b07292a5ad742550ecedb80014dfc232ccca.tar.gz
openbsd-22b5b07292a5ad742550ecedb80014dfc232ccca.tar.bz2
openbsd-22b5b07292a5ad742550ecedb80014dfc232ccca.zip
Change hard coded numbers to sizeof(buf). Also change some
sizeof(buf) - 1 to sizeof(buf), since fgets takes the whole buffer size. Based on diff from Charles Longeau <chl at tuxfamily dot org> long ago. OK millert@.
Diffstat (limited to 'src/lib/libc/crypt')
-rw-r--r--src/lib/libc/crypt/bcrypt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libc/crypt/bcrypt.c b/src/lib/libc/crypt/bcrypt.c
index 3a09112b40..2f547585a3 100644
--- a/src/lib/libc/crypt/bcrypt.c
+++ b/src/lib/libc/crypt/bcrypt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: bcrypt.c,v 1.21 2006/07/04 19:06:00 otto Exp $ */ 1/* $OpenBSD: bcrypt.c,v 1.22 2007/02/20 01:44:16 ray Exp $ */
2 2
3/* 3/*
4 * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de> 4 * Copyright 1997 Niels Provos <provos@physnet.uni-hamburg.de>
@@ -320,11 +320,11 @@ main()
320 snprintf(salt + 3, 4, "%2.2u$", 5); 320 snprintf(salt + 3, 4, "%2.2u$", 5);
321 321
322 printf("24 bytes of salt: "); 322 printf("24 bytes of salt: ");
323 fgets(salt + 6, 94, stdin); 323 fgets(salt + 6, sizeof(salt) - 6, stdin);
324 salt[99] = 0; 324 salt[99] = 0;
325 printf("72 bytes of password: "); 325 printf("72 bytes of password: ");
326 fpurge(stdin); 326 fpurge(stdin);
327 fgets(blubber, 73, stdin); 327 fgets(blubber, sizeof(blubber), stdin);
328 blubber[72] = 0; 328 blubber[72] = 0;
329 329
330 p = crypt(blubber, salt); 330 p = crypt(blubber, salt);