summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-03-27 23:43:37 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-03-27 23:43:37 +0000
commitc0c13244578826bdb8f15ee818a65f1f1816c7c3 (patch)
tree76b49595596ee76c26ab389af12c94872cb0cd91
parentad9eabf2e63abf8c503f6ae14db7bd3128292ee1 (diff)
Fix core dump.
-rw-r--r--usr.bin/encrypt/encrypt.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/encrypt/encrypt.c b/usr.bin/encrypt/encrypt.c
index 739cb012ca5..ed4792f96fc 100644
--- a/usr.bin/encrypt/encrypt.c
+++ b/usr.bin/encrypt/encrypt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: encrypt.c,v 1.3 1996/08/26 08:41:26 downsj Exp $ */
+/* $OpenBSD: encrypt.c,v 1.4 1997/03/27 23:43:36 downsj Exp $ */
/*
* Copyright (c) 1996, Jason Downs. All rights reserved.
@@ -90,6 +90,8 @@ int main(argc, argv)
break;
case 's':
salt = optarg;
+ if (salt[0] == '$') /* -s is only for DES. */
+ usage();
break;
default:
usage();
@@ -105,7 +107,7 @@ int main(argc, argv)
if (do_makekey && (do_md5 || (salt != (char *)NULL)))
usage();
- if ((argc - optind) < 1) {
+ if (((argc - optind) < 1) || do_makekey) {
char line[BUFSIZ], *string, msalt[3];
/* Encrypt stdin to stdout. */