svn commit: r358183 - head/usr.bin/dtc

Rebecca Cran bcran at FreeBSD.org
Thu Feb 20 21:30:00 UTC 2020


Author: bcran
Date: Thu Feb 20 21:29:59 2020
New Revision: 358183
URL: https://svnweb.freebsd.org/changeset/base/358183

Log:
  dtc: remove unknown option printf, since getopt will print it
  
  Since we don't set opterr to 0, getopt prints a message when it
  encounters an unknown/invalid option. We therefore don't need to
  print our own message in the default handler.
  
  Reviewed by:	kevans, theraven
  Differential Revision:	https://reviews.freebsd.org/D23662

Modified:
  head/usr.bin/dtc/dtc.cc

Modified: head/usr.bin/dtc/dtc.cc
==============================================================================
--- head/usr.bin/dtc/dtc.cc	Thu Feb 20 21:25:12 2020	(r358182)
+++ head/usr.bin/dtc/dtc.cc	Thu Feb 20 21:29:59 2020	(r358183)
@@ -304,7 +304,10 @@ main(int argc, char **argv)
 			}
 			break;
 		default:
-			fprintf(stderr, "Unknown option %c\n", ch);
+			/* 
+			 * Since opterr is non-zero, getopt will have
+			 * already printed an error message.
+			 */
 			return EXIT_FAILURE;
 		}
 	}


More information about the svn-src-all mailing list