From: millert Date: Wed, 8 Jan 2014 16:16:44 +0000 (+0000) Subject: err() not errx() when fopen fails. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7a2b4165e4801202038e905587e99ebdd7d64e92;p=openbsd err() not errx() when fopen fails. --- diff --git a/bin/md5/md5.c b/bin/md5/md5.c index 6606593d245..0e5f10526ed 100644 --- a/bin/md5/md5.c +++ b/bin/md5/md5.c @@ -1,4 +1,4 @@ -/* $OpenBSD: md5.c,v 1.62 2014/01/08 16:13:11 millert Exp $ */ +/* $OpenBSD: md5.c,v 1.63 2014/01/08 16:16:44 millert Exp $ */ /* * Copyright (c) 2001,2003,2005-2007,2010,2013,2014 @@ -307,6 +307,11 @@ main(int argc, char **argv) case 'c': cflag = 1; break; + case 'h': + ofile = fopen(optarg, "w"); + if (ofile == NULL) + err(1, "%s", optarg); + break; #if !defined(SMALL) case 'o': if (strcmp(optarg, "1") == 0) @@ -326,11 +331,6 @@ main(int argc, char **argv) hash_insert(&hl, hf, 0); break; #endif /* !defined(SMALL) */ - case 'h': - ofile = fopen(optarg, "w"); - if (ofile == NULL) - errx(1, "%s", optarg); - break; case 'p': pflag = 1; break;