Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jan 2018 07:28:58 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r327580 - head/usr.sbin/ifmcstat
Message-ID:  <201801050728.w057SwuP039943@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Fri Jan  5 07:28:58 2018
New Revision: 327580
URL: https://svnweb.freebsd.org/changeset/base/327580

Log:
  bits is never null when we call ot. Add an assert to that effect and
  remove test for NULL.
  
  CID: 270774

Modified:
  head/usr.sbin/ifmcstat/printb.c

Modified: head/usr.sbin/ifmcstat/printb.c
==============================================================================
--- head/usr.sbin/ifmcstat/printb.c	Fri Jan  5 07:28:48 2018	(r327579)
+++ head/usr.sbin/ifmcstat/printb.c	Fri Jan  5 07:28:58 2018	(r327580)
@@ -32,6 +32,7 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
+#include <assert.h>
 #include <stdio.h>
 
 /*
@@ -43,7 +44,8 @@ printb(const char *s, unsigned int v, const char *bits
 	int i, any = 0;
 	char c;
 
-	if (bits && *bits == 8)
+	assert(bits != NULL);
+	if (*bits == 8)
 		printf("%s=%o", s, v);
 	else
 		printf("%s=%x", s, v);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801050728.w057SwuP039943>