Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Apr 2016 00:29:01 +0000 (UTC)
From:      Marcelo Araujo <araujo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r298599 - head/usr.bin/stat
Message-ID:  <201604260029.u3Q0T1KZ070277@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: araujo
Date: Tue Apr 26 00:29:00 2016
New Revision: 298599
URL: https://svnweb.freebsd.org/changeset/base/298599

Log:
  Use MIN() instead of MAX() as the previous syntax was wrote in a weird and
  confused way: "prec > 9 ? 9 : prec".
  
  Submitted by:	pfg, ngie and luke <luke.tw@gmail.com>
  MFC after:	2 weeks.

Modified:
  head/usr.bin/stat/stat.c

Modified: head/usr.bin/stat/stat.c
==============================================================================
--- head/usr.bin/stat/stat.c	Mon Apr 25 23:12:39 2016	(r298598)
+++ head/usr.bin/stat/stat.c	Tue Apr 26 00:29:00 2016	(r298599)
@@ -1025,7 +1025,7 @@ format1(const struct stat *st,
 		 *
 		 * Nanoseconds: long.
 		 */
-		(void)snprintf(tmp, sizeof(tmp), "%dld", MAX(9, prec));
+		(void)snprintf(tmp, sizeof(tmp), "%dld", MIN(prec, 9));
 		(void)strcat(lfmt, tmp);
 
 		/*



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