From: downsj Date: Thu, 27 Mar 1997 23:43:36 +0000 (+0000) Subject: Fix core dump. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=16e3dda4f08d06448365701ad6e7270196334c31;p=openbsd Fix core dump. --- 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. */